From 60acc76afc72593ca0454d5d2b486e36447359ec Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 26 Oct 2023 17:12:54 +0200 Subject: [PATCH 1/2] console: preserve the resourceVersion of the consolePlugin preserve the resourceVersion of the consolePlugin which is required for consolePlugin update. Signed-off-by: Madhu Rajanna --- controllers/clusterversion_controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/clusterversion_controller.go b/controllers/clusterversion_controller.go index 848db473..f35084db 100644 --- a/controllers/clusterversion_controller.go +++ b/controllers/clusterversion_controller.go @@ -423,7 +423,10 @@ func (c *ClusterVersionReconciler) ensureConsolePlugin() error { consolePlugin := console.GetConsolePlugin(c.ConsolePort, c.OperatorNamespace) err = c.createOrUpdate(consolePlugin, func() error { + // preserve the resourceVersion of the consolePlugin + resourceVersion := consolePlugin.ResourceVersion console.GetConsolePlugin(c.ConsolePort, c.OperatorNamespace).DeepCopyInto(consolePlugin) + consolePlugin.ResourceVersion = resourceVersion return nil }) From 502f8e366ec6a3e2555c268c4323eb79ac6e973a Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 26 Oct 2023 17:21:08 +0200 Subject: [PATCH 2/2] test: fix go-lint issue added required linter comment to skip go-lint ci checks. Signed-off-by: Madhu Rajanna --- controllers/suite_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 961c225c..91347311 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -22,8 +22,8 @@ import ( "github.com/red-hat-storage/ocs-client-operator/api/v1alpha1" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + . "github.com/onsi/ginkgo" //nolint:revive // ginkgo initialization + . "github.com/onsi/gomega" //nolint:revive // gomega initialization "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest"