From 442fc666f219b8a13da6cc582697f6d402924324 Mon Sep 17 00:00:00 2001 From: Zhiwei Yin Date: Sat, 20 Feb 2021 10:10:26 +0800 Subject: [PATCH] fix typo Signed-off-by: Zhiwei Yin --- pkg/cmd/spoke/agent.go | 2 +- pkg/spoke/controllers/constants.go | 2 +- .../manifestcontroller/manifestwork_controller.go | 8 ++++---- .../statuscontroller/availablestatus_controller.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/spoke/agent.go b/pkg/cmd/spoke/agent.go index 06b103c9d..3d6517db0 100644 --- a/pkg/cmd/spoke/agent.go +++ b/pkg/cmd/spoke/agent.go @@ -9,7 +9,7 @@ import ( "github.com/open-cluster-management/work/pkg/version" ) -// NewWorkloadAgent generatee a command to start workload agent +// NewWorkloadAgent generates a command to start workload agent func NewWorkloadAgent() *cobra.Command { o := spoke.NewWorkloadAgentOptions() cmd := controllercmd. diff --git a/pkg/spoke/controllers/constants.go b/pkg/spoke/controllers/constants.go index 9e47a36af..30f8b0167 100644 --- a/pkg/spoke/controllers/constants.go +++ b/pkg/spoke/controllers/constants.go @@ -5,7 +5,7 @@ const ( // related appliedmanifestwork of a manifestwork are deleted before the manifestwork itself is deleted ManifestWorkFinalizer = "cluster.open-cluster-management.io/manifest-work-cleanup" // AppliedManifestWorkFinalizer is the name of the finalizer added to appliedmanifestwork. It is to - // ensure all resource relateds to appliedmanifestwork is deleted before appliedmanifestwork itself + // ensure all resource relates to appliedmanifestwork is deleted before appliedmanifestwork itself // is deleted. AppliedManifestWorkFinalizer = "cluster.open-cluster-management.io/applied-manifest-work-cleanup" ) diff --git a/pkg/spoke/controllers/manifestcontroller/manifestwork_controller.go b/pkg/spoke/controllers/manifestcontroller/manifestwork_controller.go index b749bb762..e42c383a9 100644 --- a/pkg/spoke/controllers/manifestcontroller/manifestwork_controller.go +++ b/pkg/spoke/controllers/manifestcontroller/manifestwork_controller.go @@ -295,7 +295,7 @@ func (m *ManifestWorkController) generateUpdateStatusFunc(newManifestConditions } } -// isDecodeError is to check if the error returned from resourceapply is due to that the object cannnot +// isDecodeError is to check if the error returned from resourceapply is due to that the object cannot // be decoded or no typed client can handle the object. func isDecodeError(err error) bool { return err != nil && strings.HasPrefix(err.Error(), "cannot decode") @@ -308,12 +308,12 @@ func isUnhandledError(err error) bool { } // isSameUnstructured compares the two unstructured object. -// The comparison ignores the metadata and status field, and check if the two objects are sementically equal. +// The comparison ignores the metadata and status field, and check if the two objects are semantically equal. func isSameUnstructured(obj1, obj2 *unstructured.Unstructured) bool { obj1Copy := obj1.DeepCopy() obj2Copy := obj2.DeepCopy() - // Comapre gvk, name, namespace at first + // Compare gvk, name, namespace at first if obj1Copy.GroupVersionKind() != obj2Copy.GroupVersionKind() { return false } @@ -332,7 +332,7 @@ func isSameUnstructured(obj1, obj2 *unstructured.Unstructured) bool { return false } - // Compare sementically after removing metadata and status field + // Compare semantically after removing metadata and status field delete(obj1Copy.Object, "metadata") delete(obj2Copy.Object, "metadata") delete(obj1Copy.Object, "status") diff --git a/pkg/spoke/controllers/statuscontroller/availablestatus_controller.go b/pkg/spoke/controllers/statuscontroller/availablestatus_controller.go index 89735c63b..d47bbbad1 100644 --- a/pkg/spoke/controllers/statuscontroller/availablestatus_controller.go +++ b/pkg/spoke/controllers/statuscontroller/availablestatus_controller.go @@ -24,7 +24,7 @@ import ( "k8s.io/klog/v2" ) -// ControllerSyncInterval is exposed so that integration tests can crank up the constroller resync speed. +// ControllerSyncInterval is exposed so that integration tests can crank up the controller resync speed. var ControllerReSyncInterval = 30 * time.Second // AvailableStatusController is to update the available status conditions of both manifests and manifestworks.