Skip to content

Commit

Permalink
Refactor imports in odfinfoconfig.go
Browse files Browse the repository at this point in the history
- Add 'gopkg.in/yaml.v2' import.
- Maintain consistent import grouping for better readability.

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 <[email protected]>
  • Loading branch information
vbnrh committed Aug 2, 2024
1 parent ad2eaa4 commit a1b2744
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions controllers/storagecluster/odfinfoconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion controllers/storagecluster/odfinfoconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a1b2744

Please sign in to comment.