// Helper method to check the local Terraform version against the configured
// version in the remote workspace, returning diagnostics if they conflict.
Helper method to check the local Terraform version against the configured
version in the remote workspace, returning diagnostics if they conflict.
// Helper method to check the local Terraform version against the configured // version in the remote workspace returning diagnostics if they conflict .
func (m *Meta) remoteBackendVersionCheck(b backend.Backend, workspace string) tfdiags.Diagnostics {
	var diags tfdiags.Diagnostics
	if rb, ok := b.(*remoteBackend.Remote); ok {
		if m.ignoreRemoteVersion {
			rb.IgnoreVersionConflict()
		}
		versionDiags := rb.VerifyWorkspaceTerraformVersion(workspace)
		diags = diags.Append(versionDiags)
		if !diags.HasErrors() {
			rb.IgnoreVersionConflict()
		}
	}
	return diags
}
func ( m * Meta ) remoteBackendVersionCheck ( b backend . Backend , workspace string ) tfdiags . Diagnostics { var diags tfdiags . Diagnostics if rb , ok := b . ( * remoteBackend . Remote ) ; ok { if m . ignoreRemoteVersion { rb . IgnoreVersionConflict ( ) } versionDiags := rb . VerifyWorkspaceTerraformVersion ( workspace ) diags = diags . Append ( versionDiags ) if ! diags . HasErrors ( ) { rb . IgnoreVersionConflict ( ) } } return diags }
Helper method to check the local Terraform version against the configured
version in the remote workspace, returning diagnostics if they conflict.
Helper method to check the local Terraform version against the configured version in the remote workspace returning diagnostics if they conflict .
// Allow user override based on command-line flag // If the override is set, this check will return a warning instead of // an error // If there are no errors resulting from this check, we do not need to // check again