Skip to content

Commit

Permalink
Merge pull request #2619 from Nikhil-Ladha/fix-sc-version
Browse files Browse the repository at this point in the history
Fix storagecluster version in odfinfoconfig unit test
  • Loading branch information
openshift-merge-bot[bot] committed May 20, 2024
2 parents ec44394 + 88bfcf0 commit c92a7d9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
7 changes: 4 additions & 3 deletions controllers/storagecluster/initialization_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package storagecluster
import (
"context"
"fmt"
"os"
"testing"

"github.com/blang/semver/v4"
oprverion "github.com/operator-framework/api/pkg/lib/version"
opv1a1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
ocsversion "github.com/red-hat-storage/ocs-operator/v4/version"
"os"
"testing"

"github.com/imdario/mergo"
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
Expand Down Expand Up @@ -355,7 +356,7 @@ func createFakeInitializationStorageClusterReconciler(t *testing.T, obj ...runti
Phase: cephv1.ConditionType(util.PhaseReady),
},
}
verOcs, err := semver.Make(getSemVer(ocsversion.Version, 1, true))
verOcs, err := semver.Make(ocsversion.Version)
if err != nil {
panic(err)
}
Expand Down
10 changes: 6 additions & 4 deletions controllers/storagecluster/odfinfoconfig_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package storagecluster

import (
"os"
"testing"

"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"
"k8s.io/apimachinery/pkg/types"
"os"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"
"testing"

api "github.com/red-hat-storage/ocs-operator/api/v4/v1"
"gotest.tools/v3/assert"
Expand Down Expand Up @@ -38,7 +40,7 @@ func TestOdfInfoConfig(t *testing.T) {
Kind: "StorageSystem",
APIVersion: "v1",
},
ocsVersion: "3.16.0",
ocsVersion: ocsversion.Version,
deploymentType: odfDeploymentTypeInternal,
storageClusterNamespacedName: types.NamespacedName{Name: "storage-test", Namespace: namespace},
cephClusterFSID: cephFSID,
Expand All @@ -52,7 +54,7 @@ func TestOdfInfoConfig(t *testing.T) {
Kind: "StorageSystem",
APIVersion: "v1",
},
ocsVersion: "3.16.0",
ocsVersion: ocsversion.Version,
deploymentType: odfDeploymentTypeInternal,
storageClusterNamespacedName: types.NamespacedName{Name: "storage-test", Namespace: namespace},
cephClusterFSID: cephFSID,
Expand Down
9 changes: 5 additions & 4 deletions controllers/storagecluster/storagecluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package storagecluster
import (
"context"
"fmt"
opverion "github.com/operator-framework/api/pkg/lib/version"
opv1a1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
ocsversion "github.com/red-hat-storage/ocs-operator/v4/version"
"net"
"os"
"regexp"
"testing"

opverion "github.com/operator-framework/api/pkg/lib/version"
opv1a1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
ocsversion "github.com/red-hat-storage/ocs-operator/v4/version"

"github.com/blang/semver/v4"
snapapi "github.com/kubernetes-csi/external-snapshotter/client/v7/apis/volumesnapshot/v1"
nbv1 "github.com/noobaa/noobaa-operator/v5/pkg/apis/noobaa/v1alpha1"
Expand Down Expand Up @@ -1128,7 +1129,7 @@ func createFakeStorageClusterReconciler(t *testing.T, obj ...runtime.Object) Sto
Phase: rookCephv1.ConditionType(statusutil.PhaseReady),
},
}
verOcs, err := semver.Make(getSemVer(ocsversion.Version, 1, true))
verOcs, err := semver.Make(ocsversion.Version)
if err != nil {
panic(fmt.Sprintf("failed to parse version: %v", err))
}
Expand Down

0 comments on commit c92a7d9

Please sign in to comment.