From 5de31b625686d2555f13051c31f13026215645f1 Mon Sep 17 00:00:00 2001 From: Leela Venkaiah G Date: Thu, 4 Jan 2024 16:40:04 +0530 Subject: [PATCH] ci: fix codespell and golint Signed-off-by: Leela Venkaiah G --- controllers/storageclient_controller.go | 2 +- controllers/suite_test.go | 2 +- controllers/upgrade_controller.go | 8 ++++---- controllers/upgrade_controller_test.go | 2 +- main.go | 2 +- service/status-report/main.go | 4 ---- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/controllers/storageclient_controller.go b/controllers/storageclient_controller.go index bde2b554b..c472a8a7c 100644 --- a/controllers/storageclient_controller.go +++ b/controllers/storageclient_controller.go @@ -73,7 +73,7 @@ type StorageClientReconciler struct { OperatorNamespace string OperatorVersion string - // this can be part of reconciler as after a plaform update + // this can be part of reconciler as after a platform update // operator will get restarted and fetches latest version PlatformVersion string } diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 3cf9f7159..4767eab37 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -168,7 +168,7 @@ var _ = BeforeSuite(func() { Expect(err).ToNot(HaveOccurred(), "failed to run manager") }() - // create auxillary resources + // create auxiliary resources operatorNS := &corev1.Namespace{} operatorNS.Name = testOperatorNamespace Expect(k8sClient.Create(ctx, operatorNS)).Should(Succeed()) diff --git a/controllers/upgrade_controller.go b/controllers/upgrade_controller.go index f9fb5241a..ecb7dec46 100644 --- a/controllers/upgrade_controller.go +++ b/controllers/upgrade_controller.go @@ -44,7 +44,7 @@ import ( const ( ocsClientOperatorSubscriptionPackageName = "ocs-client-operator" - // TODO(lgangava): there can be "eus" or "fast" or "canditate" supported channels + // TODO(lgangava): there can be "eus" or "fast" or "candidate" supported channels // and custom channels also might exist, either get this data as part of a configmap // or cut the name by '-' subscriptionChannelNamePrefix = "stable-" @@ -125,7 +125,7 @@ func (r *UpgradeReconciler) Reconcile(ctx context.Context, _ ctrl.Request) (ctrl // differentiate between reconciler errors and not upgradeable errors conditionStatus = metav1.ConditionFalse conditionMessage = fmt.Sprintf("Operator could not be upgraded due to: %v", err) - r.log.Error(err, "an error occured during reconcilePhases") + r.log.Error(err, "an error occurred during reconcilePhases") } err = errors.Join(err, r.setOperatorCondition(conditionStatus, conditionMessage)) @@ -154,7 +154,7 @@ func (r *UpgradeReconciler) reconcileSubscriptionChannel() error { desiredVersions := make([]string, 0, len(storageClientList.Items)) for idx := range storageClientList.Items { desiredVersion := storageClientList.Items[idx].Status.Operator.DesiredVersion - // usually these versions will not have patch version, so we are adding an arbitrary num for semver comparision + // usually these versions will not have patch version, so we are adding an arbitrary num for semver comparison desiredVersion += dummyPatchVersion desiredVersions = append(desiredVersions, desiredVersion) } @@ -219,7 +219,7 @@ func (r *UpgradeReconciler) reconcileSubscriptionChannel() error { if platformVersion.Major < channelVersion.Major || platformVersion.Minor < channelVersion.Minor { return fmt.Errorf("subscription channel name is changed outside of operator (subscription is ahead of platform)") } - // TODO (lgangava): as of now there's no way to distingush desiredVersion vs stale desiredVersion + // TODO (lgangava): as of now there's no way to distinguish desiredVersion vs stale desiredVersion // and we aren't checking dependents for updating operatorcondition return nil diff --git a/controllers/upgrade_controller_test.go b/controllers/upgrade_controller_test.go index 4e4193f49..5b3d20c6b 100644 --- a/controllers/upgrade_controller_test.go +++ b/controllers/upgrade_controller_test.go @@ -102,7 +102,7 @@ var _ = Describe("Upgrade Controller", func() { }) }) - When("a storageclient desired verison and subscription is same", func() { + When("a storageclient desired version and subscription is same", func() { BeforeEach(func() { createClient(client1) setSubscriptionChannel(testCurrentVersion) diff --git a/main.go b/main.go index 97f286856..6479ecfbb 100644 --- a/main.go +++ b/main.go @@ -130,7 +130,7 @@ func main() { platformVersion, err := controllers.GetPlatformVersion(context.TODO(), apiClient) if err != nil { - setupLog.Error(err, "unable to find platform verison") + setupLog.Error(err, "unable to find platform version") os.Exit(1) } diff --git a/service/status-report/main.go b/service/status-report/main.go index f038dd78c..ea879a89d 100644 --- a/service/status-report/main.go +++ b/service/status-report/main.go @@ -35,10 +35,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" ) -const ( - csvPrefix = "ocs-client-operator" -) - // TODO: refactor main as the responsibilities grew significantly func main() { scheme := runtime.NewScheme()