diff --git a/.golangci.yaml b/.golangci.yaml index 85f69b647f1..05657c77c63 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -38,7 +38,7 @@ linters: - govet # - importas # - ineffassign - # - misspell + - misspell - revive # replacement for golint # - staticcheck # - typecheck diff --git a/operator/pkg/controllers/configconnector/configconnector_controller.go b/operator/pkg/controllers/configconnector/configconnector_controller.go index 0e65522c159..c2a9b469520 100644 --- a/operator/pkg/controllers/configconnector/configconnector_controller.go +++ b/operator/pkg/controllers/configconnector/configconnector_controller.go @@ -421,7 +421,7 @@ func (r *Reconciler) verifyPerNamespaceControllerManagerPodsAreDeleted(ctx conte if len(podList.Items) == 1 && podList.Items[0].Name == k8s.ControllerManagerPodForClusterMode { return nil } - return fmt.Errorf("per-namespace controller manager pods are not yet deleted by configconnectorcontext controller, reenquee the reconcilation for another attempt later; "+ + return fmt.Errorf("per-namespace controller manager pods are not yet deleted by configconnectorcontext controller, reenquee the reconciliation for another attempt later; "+ "remaining pods include, but may not be limited to %v", podNames) } diff --git a/operator/pkg/controllers/configconnectorcontext/configconnectorcontext_controller.go b/operator/pkg/controllers/configconnectorcontext/configconnectorcontext_controller.go index 910973cc9f9..e6947eb828b 100644 --- a/operator/pkg/controllers/configconnectorcontext/configconnectorcontext_controller.go +++ b/operator/pkg/controllers/configconnectorcontext/configconnectorcontext_controller.go @@ -363,7 +363,7 @@ func (r *Reconciler) verifyControllerManagerPodForClusterModeIsDeleted(ctx conte r.log.Info("verifying that cluster mode workload is deleted...", "StatefulSet", stsKey, "Pod", podKey) err := r.client.Get(ctx, stsKey, sts) if err == nil { - return fmt.Errorf("statefulset %v is not yet deleted, reenquee the reconcilation for another attempt later", stsKey) + return fmt.Errorf("statefulset %v is not yet deleted, reenquee the reconciliation for another attempt later", stsKey) } if !apierrors.IsNotFound(err) { return fmt.Errorf("error getting the StatefulSet %v: %w", stsKey, err) @@ -371,7 +371,7 @@ func (r *Reconciler) verifyControllerManagerPodForClusterModeIsDeleted(ctx conte err = r.client.Get(ctx, podKey, pod) if err == nil { - return fmt.Errorf("pod %v is not yet deleted, reenquee the reconcilation for another attempt later", stsKey) + return fmt.Errorf("pod %v is not yet deleted, reenquee the reconciliation for another attempt later", stsKey) } if !apierrors.IsNotFound(err) { return fmt.Errorf("error getting the pod %v: %w", podKey, err) @@ -388,13 +388,13 @@ func (r *Reconciler) verifyCNRMSystemNamespaceIsActive(ctx context.Context) erro } if err := r.client.Get(ctx, key, n); err != nil { if apierrors.IsNotFound(err) { - return fmt.Errorf("ConfigConnector system namespace %v is not created by configconnector controller yet, reenquee the reconcilation for another attempt later", k8s.CNRMSystemNamespace) + return fmt.Errorf("ConfigConnector system namespace %v is not created by configconnector controller yet, reenquee the reconciliation for another attempt later", k8s.CNRMSystemNamespace) } return fmt.Errorf("error getting the ConfigConnector system namespace %v: %w", key, err) } if !n.GetDeletionTimestamp().IsZero() { - return fmt.Errorf("ConfigConnector system namespace %v is pending deletion, stop the reconcilation", k8s.CNRMSystemNamespace) + return fmt.Errorf("ConfigConnector system namespace %v is pending deletion, stop the reconciliation", k8s.CNRMSystemNamespace) } return nil } diff --git a/pkg/apis/core/v1alpha1/servicemapping_types.go b/pkg/apis/core/v1alpha1/servicemapping_types.go index 65282511aa6..fd440bcf784 100644 --- a/pkg/apis/core/v1alpha1/servicemapping_types.go +++ b/pkg/apis/core/v1alpha1/servicemapping_types.go @@ -160,7 +160,7 @@ type ResourceConfig struct { AutoGenerated bool `json:"autoGenerated,omitempty"` // ReconciliationIntervalInSeconds specifies the default mean reconciliation interval for this resource. - // Providing the value in servicemapping config is optional. If not explicity configured a global + // Providing the value in servicemapping config is optional. If not explicitly configured a global // default value of 600 will be used ReconciliationIntervalInSeconds *uint32 `json:"reconciliationIntervalInSeconds,omitempty"` diff --git a/pkg/cli/stream/yamlstream.go b/pkg/cli/stream/yamlstream.go index 2a4d0d789f9..b30b010910d 100644 --- a/pkg/cli/stream/yamlstream.go +++ b/pkg/cli/stream/yamlstream.go @@ -56,7 +56,7 @@ func (y *YAMLStream) Next(ctx context.Context) ([]byte, *unstructured.Unstructur if y.nextErr == nil && y.nextBytes == nil { // this occurs on the first call to Next() or AFTER an error, while putting a fillNext(...) in the // NewYAMLStream(...) would result in cleaner code it would mean that NewYAMLStream(...) could take a "long time" - // while contacting GCP to get the first unstructured which could result in some undesireable user experiences + // while contacting GCP to get the first unstructured which could result in some undesirable user experiences y.fillNext(ctx) } // if this is EOF and we have not YET returned the terminator AND we wrote at least one result, return "...", otherwise, return EOF diff --git a/pkg/controller/dcl/controller.go b/pkg/controller/dcl/controller.go index 43281c14d3f..112b2905d14 100644 --- a/pkg/controller/dcl/controller.go +++ b/pkg/controller/dcl/controller.go @@ -282,7 +282,7 @@ func (r *Reconciler) sync(ctx context.Context, resource *dcl.Resource) (requeue // "recreating" resources with server-generated IDs technically creates // a brand new resource instead. return false, r.HandleUpdateFailed(ctx, &resource.Resource, - fmt.Errorf("underlying resource with server-generated Id %s no longer exists and can't be recreated without creating a brand new resource with a different identifer", resource.Spec[k8s.ResourceIDFieldName])) + fmt.Errorf("underlying resource with server-generated Id %s no longer exists and can't be recreated without creating a brand new resource with a different identifier", resource.Spec[k8s.ResourceIDFieldName])) } // attempt to obtain the resource lease diff --git a/pkg/controller/direct/mappings/map.go b/pkg/controller/direct/mappings/map.go index 8aa3101764d..52ba83dcd8c 100644 --- a/pkg/controller/direct/mappings/map.go +++ b/pkg/controller/direct/mappings/map.go @@ -23,7 +23,7 @@ type typeMapping interface { // ToType returns the type we will convert to. ToType() reflect.Type - // Map performs the actual converstion from one value to another. + // Map performs the actual conversion from one value to another. Map(in *point, out *point) error } diff --git a/pkg/controller/iam/iamclient/dcliamclient_test.go b/pkg/controller/iam/iamclient/dcliamclient_test.go index 8a976d3c6a4..7eb35775187 100644 --- a/pkg/controller/iam/iamclient/dcliamclient_test.go +++ b/pkg/controller/iam/iamclient/dcliamclient_test.go @@ -501,7 +501,7 @@ func TestIAMPolicyFromDCLResource(t *testing.T) { }, }, { - name: "iam policy with mulitple bindings/members/conditions", + name: "iam policy with multiple bindings/members/conditions", dclResource: &dclunstruct.Resource{ STV: dclunstruct.ServiceTypeVersion{ Service: "iam", diff --git a/pkg/controller/unmanageddetector/predicate.go b/pkg/controller/unmanageddetector/predicate.go index 837ef4807bc..ec680a87b57 100644 --- a/pkg/controller/unmanageddetector/predicate.go +++ b/pkg/controller/unmanageddetector/predicate.go @@ -31,7 +31,7 @@ func (Predicate) Create(_ event.CreateEvent) bool { // Firstly, an Update event implies there had been a Create event already, // which would have been handled by unmanaged-detector. // -// Secondly, once unmanaged-detector successfuly reconciles a resource once, it +// Secondly, once unmanaged-detector successfully reconciles a resource once, it // never has to reconcile the resource again. This is because if the resource // is marked Unmanaged, then unmanaged-detector's job is done: the onus is now // on the user to create a ConfigConnectorContext. On the other hand, if the diff --git a/pkg/dcl/conversion/converter.go b/pkg/dcl/conversion/converter.go index b7ba433361d..ff68ac17684 100644 --- a/pkg/dcl/conversion/converter.go +++ b/pkg/dcl/conversion/converter.go @@ -152,7 +152,7 @@ func (c *Converter) DCLObjectToKRMObject(resource *dclunstruct.Resource) (*unstr // hierarchical references. if !resourceMetadata.SupportsHierarchicalReferences { if err := liftDCLContainerField(obj, dclSchema); err != nil { - return nil, fmt.Errorf("error lifting contianer field to annotation: %w", err) + return nil, fmt.Errorf("error lifting container field to annotation: %w", err) } } if err := convertToKRMResourceIDField(obj, dclSchema); err != nil { @@ -638,7 +638,7 @@ func resolveReferenceValue(obj map[string]interface{}, schema *openapi.Schema) ( func convertToDCLContainerField(obj *unstructured.Unstructured, r *dclunstruct.Resource, schema *openapi.Schema) error { container, found, err := getContainerFieldName(schema) if err != nil { - return fmt.Errorf("error getting the contianer field name %w", err) + return fmt.Errorf("error getting the container field name %w", err) } if !found { return nil @@ -656,7 +656,7 @@ func convertToDCLContainerField(obj *unstructured.Unstructured, r *dclunstruct.R func liftDCLContainerField(obj *unstructured.Unstructured, schema *openapi.Schema) error { container, found, err := getContainerFieldName(schema) if err != nil { - return fmt.Errorf("error getting the contianer field name %w", err) + return fmt.Errorf("error getting the container field name %w", err) } if !found { return nil diff --git a/pkg/dcl/metadata/metadata.go b/pkg/dcl/metadata/metadata.go index 21b87946055..dc285b31d83 100644 --- a/pkg/dcl/metadata/metadata.go +++ b/pkg/dcl/metadata/metadata.go @@ -910,7 +910,7 @@ type Resource struct { // resource supports the x-dcl-parent-container extension. SupportsContainerAnnotations bool // ReconciliationIntervalInSeconds specifies the default mean reconciliation interval for this resource. - // Providing the value in DCL metadata config is optional. If not explicity configured a global + // Providing the value in DCL metadata config is optional. If not explicitly configured a global // default value of 600 will be used. ReconciliationIntervalInSeconds *uint32 } diff --git a/pkg/k8s/references.go b/pkg/k8s/references.go index 10549663b18..fe6824897a2 100644 --- a/pkg/k8s/references.go +++ b/pkg/k8s/references.go @@ -160,7 +160,7 @@ func SetDefaultHierarchicalReference(resource *Resource, ns *corev1.Namespace, h // GetHierarchicalReference gets the resource reference within the resource // that corresponds to any of the given hierarchical reference configurations, -// as well as the the hierachical reference configuration associated with the +// as well as the the hierarchical reference configuration associated with the // resource reference. Returns a nil resource reference if none is found. // Returns an error if multiple resource references are found (an invalid // resource state as resources can have at most one hierarchical reference). diff --git a/pkg/krmtotf/krmtotf.go b/pkg/krmtotf/krmtotf.go index a76f54cb67f..ba60c221685 100644 --- a/pkg/krmtotf/krmtotf.go +++ b/pkg/krmtotf/krmtotf.go @@ -50,7 +50,7 @@ func KRMResourceToTFResourceConfig(r *Resource, c client.Client, smLoader *servi // KRMResourceToTFResourceConfigFull is a more flexible version of KRMResourceToTFResourceConfig, // including the following additional flags: // - liveState: if set, these values will be used as the default values of the returned tfConfig, subject to -// be overriden by r.spec, etc. +// be overridden by r.spec, etc. // - jsonSchema: if set, externally managed fields will be populated. // - mustResolveSensitiveFields: if set, sensitive fields will be resolved. // - defaultLabels: if set, these labels will be added to tfConfig. @@ -150,7 +150,7 @@ func krmObjectToTFObject(obj map[string]interface{}, resource *tfschema.Resource tfKey := text.AsSnakeCase(k) schema, ok := resource.Schema[tfKey] if !ok { - // TODO(b/239223470): We want to error out explicity if certain field from spec + // TODO(b/239223470): We want to error out explicitly if certain field from spec // cannot be mapped to TFObject, instead of silently swallow the error. continue } @@ -351,7 +351,7 @@ func setValue(m map[string]interface{}, path string, value interface{}) error { } // addToMap adds all the key-value pairs from the 'right' map onto the 'left' -// map. If the key already existed in the 'left' map, then it is overriden by +// map. If the key already existed in the 'left' map, then it is overridden by // the value in the 'right' map. func addToMap(left map[string]string, right map[string]string) map[string]string { left = deepcopy.StringStringMap(left) diff --git a/pkg/krmtotf/tftokrm.go b/pkg/krmtotf/tftokrm.go index 17853df4a48..0215d71c3b0 100644 --- a/pkg/krmtotf/tftokrm.go +++ b/pkg/krmtotf/tftokrm.go @@ -435,7 +435,7 @@ func getValueFromState(state map[string]interface{}, key string) (string, bool) // // prevSpec is used for multiple purposes: // - ensures the returned result has a similar order for objects in lists, reducing -// the percieved diff when applied. +// the perceived diff when applied. // - if server-side apply is used, the prevSpec value for a field will be used over // the value in state if it is managed by KCC. // - for sets (which are represented as lists), the result is a merger of both the diff --git a/pkg/resourceoverrides/sql_instance.go b/pkg/resourceoverrides/sql_instance.go index ff9f16f8f88..e0131e3cd78 100644 --- a/pkg/resourceoverrides/sql_instance.go +++ b/pkg/resourceoverrides/sql_instance.go @@ -28,7 +28,7 @@ func GetSQLInstanceResourceOverrides() ResourceOverrides { ro := ResourceOverrides{ Kind: "SQLInstance", } - // Keep the 'databaseVersion' field optional with default for backwards compatability. + // Keep the 'databaseVersion' field optional with default for backwards compatibility. // See b/206145549 for context. ro.Overrides = append(ro.Overrides, keepDatabaseVersionFieldOptionalWithDefault()) // Preserve the legacy fields for first generation sql instances that have been removed from Terraform 4.x upgrade. diff --git a/pkg/resourceoverrides/storage_bucket.go b/pkg/resourceoverrides/storage_bucket.go index 3c49479b7b9..75fe790665b 100644 --- a/pkg/resourceoverrides/storage_bucket.go +++ b/pkg/resourceoverrides/storage_bucket.go @@ -37,7 +37,7 @@ func GetStorageBucketResourceOverrides() ResourceOverrides { // Preserve the legacy field 'bucketPolicyOnly' that has been removed from Terraform 4.x upgrade. // See b/206156139 for context. ro.Overrides = append(ro.Overrides, preserveBucketPolicyOnlyField()) - // Keep the 'location' field optional and default it to 'US' for backwards compatability. + // Keep the 'location' field optional and default it to 'US' for backwards compatibility. // See b/206156139 for context. ro.Overrides = append(ro.Overrides, keepLocationFieldOptionalWithDefault()) return ro diff --git a/pkg/test/constants/constants.go b/pkg/test/constants/constants.go index ecf48e0ceeb..c3f9ce9d4a0 100644 --- a/pkg/test/constants/constants.go +++ b/pkg/test/constants/constants.go @@ -18,7 +18,7 @@ package testconstants // TestNameSubstringsToSkip contains a list of substrings // that test names are matched against, to skip. // -// Typically these are skipped temporaily, and each string +// Typically these are skipped temporarily, and each string // should include a comment with a ticket to denote the // temporary issue being addressed, and if possibly a date // to remove. diff --git a/pkg/test/constants/presubmitconstants.go b/pkg/test/constants/presubmitconstants.go index 98f90846767..a23003779c1 100644 --- a/pkg/test/constants/presubmitconstants.go +++ b/pkg/test/constants/presubmitconstants.go @@ -27,7 +27,7 @@ var ( // "" : {"", "optional testname2"} // // When adding a new service/updating this list, prioritize test cases with more - // depedencies for more resource coverage in our presubmit-lite test. + // dependencies for more resource coverage in our presubmit-lite test. RepresentativeCRUDTestsForAllServices = map[string][]string{ "accesscontextmanager": {"accesscontextmanagerserviceperimeter"}, "alloydb": {"fullalloydbcluster"},