From c88884bfad59346ff3e4f1f22b8487c62779f293 Mon Sep 17 00:00:00 2001 From: vbadrina Date: Fri, 2 Aug 2024 11:57:43 +0530 Subject: [PATCH] Refactor imports in odfinfoconfig.go - Add 'gopkg.in/yaml.v2' import. This change is required because 'sigs.k8s.io/yaml' produced a PascalCase output, which the UI cannot use. By using the new dependency 'gopkg.in/yaml.v2', we ensure the output is in camelCase, which the UI can use for its unmarshalling. Signed-off-by: vbadrina --- controllers/storagecluster/odfinfoconfig.go | 5 +++-- controllers/storagecluster/odfinfoconfig_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/storagecluster/odfinfoconfig.go b/controllers/storagecluster/odfinfoconfig.go index 2c48b2eb24..ae22baf0e8 100644 --- a/controllers/storagecluster/odfinfoconfig.go +++ b/controllers/storagecluster/odfinfoconfig.go @@ -2,21 +2,22 @@ package storagecluster import ( "fmt" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "strings" "sync" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" ocsv1a1 "github.com/red-hat-storage/ocs-operator/api/v4/v1alpha1" "github.com/red-hat-storage/ocs-operator/v4/controllers/util" + "gopkg.in/yaml.v2" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/yaml" ) const ( diff --git a/controllers/storagecluster/odfinfoconfig_test.go b/controllers/storagecluster/odfinfoconfig_test.go index 68ce89026c..1ff5a3648b 100644 --- a/controllers/storagecluster/odfinfoconfig_test.go +++ b/controllers/storagecluster/odfinfoconfig_test.go @@ -7,9 +7,9 @@ import ( "github.com/red-hat-storage/ocs-operator/api/v4/v1alpha1" "github.com/red-hat-storage/ocs-operator/v4/controllers/util" ocsversion "github.com/red-hat-storage/ocs-operator/v4/version" + "gopkg.in/yaml.v2" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/yaml" api "github.com/red-hat-storage/ocs-operator/api/v4/v1" "gotest.tools/v3/assert"