Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix storagecluster version in odfinfoconfig unit test #2619

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading