Skip to content

Commit

Permalink
chore: fix mispelling (#1396)
Browse files Browse the repository at this point in the history
* chore: fix mispelling

* Update tftokrm.go
  • Loading branch information
anhdle-sso authored Mar 20, 2024
1 parent c21e7dc commit be5a924
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ linters:
- govet
# - importas
# - ineffassign
# - misspell
- misspell
- revive # replacement for golint
# - staticcheck
# - typecheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ 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)
}

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)
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/core/v1alpha1/servicemapping_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/stream/yamlstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/dcl/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/direct/mappings/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/iam/iamclient/dcliamclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/unmanageddetector/predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkg/dcl/conversion/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/dcl/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/k8s/references.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 3 additions & 3 deletions pkg/krmtotf/krmtotf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/krmtotf/tftokrm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourceoverrides/sql_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourceoverrides/storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/constants/presubmitconstants.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (
// "<service>" : {"<kind/testname>", "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"},
Expand Down

0 comments on commit be5a924

Please sign in to comment.