From 591429bebcaf1158357f696a074de40eea853de8 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Mon, 16 Sep 2024 09:41:48 -0700 Subject: [PATCH] Use kubedb v1 api Signed-off-by: Tamal Saha --- test/e2e/e2e_suite_test.go | 4 ++-- test/e2e/framework/recommendation.go | 10 +++++----- test/e2e/recommendation_test.go | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index c8c0eaa9..561798be 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -30,7 +30,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" - kubedbapi "kubedb.dev/apimachinery/apis/kubedb/v1alpha2" + kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "kubeops.dev/supervisor/test/e2e/framework" @@ -51,7 +51,7 @@ func init() { utilruntime.Must(api.AddToScheme(scheme)) utilruntime.Must(opsapi.AddToScheme(scheme)) - utilruntime.Must(kubedbapi.AddToScheme(scheme)) + utilruntime.Must(kubedbv1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } diff --git a/test/e2e/framework/recommendation.go b/test/e2e/framework/recommendation.go index 85d48704..17f889ab 100644 --- a/test/e2e/framework/recommendation.go +++ b/test/e2e/framework/recommendation.go @@ -32,7 +32,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" kmapi "kmodules.xyz/client-go/api/v1" kmc "kmodules.xyz/client-go/client" - kubedbapi "kubedb.dev/apimachinery/apis/kubedb/v1alpha2" + kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -89,8 +89,8 @@ func (f *Framework) newMongoDBRecommendation(dbKey client.ObjectKey, deadline *m Spec: api.RecommendationSpec{ Description: "MongoDB Database Restart", Target: core.TypedLocalObjectReference{ - APIGroup: pointer.StringP(kubedbapi.SchemeGroupVersion.Group), - Kind: kubedbapi.ResourceKindMongoDB, + APIGroup: pointer.StringP(kubedbv1.SchemeGroupVersion.Group), + Kind: kubedbv1.ResourceKindMongoDB, Name: dbKey.Name, }, Operation: runtime.RawExtension{ @@ -123,8 +123,8 @@ func (f *Framework) newPostgresRecommendation(dbKey client.ObjectKey, deadline * Spec: api.RecommendationSpec{ Description: "Postgres Database Restart", Target: core.TypedLocalObjectReference{ - APIGroup: pointer.StringP(kubedbapi.SchemeGroupVersion.String()), - Kind: kubedbapi.ResourceKindPostgres, + APIGroup: pointer.StringP(kubedbv1.SchemeGroupVersion.String()), + Kind: kubedbv1.ResourceKindPostgres, Name: dbKey.Name, }, Operation: runtime.RawExtension{ diff --git a/test/e2e/recommendation_test.go b/test/e2e/recommendation_test.go index 82e462b7..141d178b 100644 --- a/test/e2e/recommendation_test.go +++ b/test/e2e/recommendation_test.go @@ -26,7 +26,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kmapi "kmodules.xyz/client-go/api/v1" - kubedbapi "kubedb.dev/apimachinery/apis/kubedb/v1alpha2" + kubedbv1 "kubedb.dev/apimachinery/apis/kubedb/v1" opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" api "kubeops.dev/supervisor/apis/supervisor/v1alpha1" "kubeops.dev/supervisor/test/e2e/framework" @@ -39,13 +39,13 @@ var _ = Describe("Supervisor E2E Testing", func() { ) var ( - createNewStandaloneMongoDB = func() *kubedbapi.MongoDB { + createNewStandaloneMongoDB = func() *kubedbv1.MongoDB { By("Creating Standalone MongoDB") mg, err := f.CreateNewStandaloneMongoDB() Expect(err).NotTo(HaveOccurred()) return mg } - createNewStandalonePostgres = func() *kubedbapi.Postgres { + createNewStandalonePostgres = func() *kubedbv1.Postgres { By("Creating Standalone Postgres") pg, err := f.CreateNewStandalonePostgres() Expect(err).NotTo(HaveOccurred()) @@ -330,8 +330,8 @@ var _ = Describe("Supervisor E2E Testing", func() { target := []api.TargetRef{ { GroupKind: metav1.GroupKind{ - Group: kubedbapi.SchemeGroupVersion.Group, - Kind: kubedbapi.ResourceKindMongoDB, + Group: kubedbv1.SchemeGroupVersion.Group, + Kind: kubedbv1.ResourceKindMongoDB, }, Operations: []api.Operation{ { @@ -486,7 +486,7 @@ var _ = Describe("Supervisor E2E Testing", func() { stopCh := make(chan bool) errCh := make(chan bool, 2) - target := metav1.GroupKind{Group: kubedbapi.SchemeGroupVersion.Group, Kind: kubedbapi.ResourceKindPostgres} + target := metav1.GroupKind{Group: kubedbv1.SchemeGroupVersion.Group, Kind: kubedbv1.ResourceKindPostgres} ensureQueuePerTargetParallelism(stopCh, errCh, target, "") waitingForRecommendationToBeSucceeded(rcmd1Key) @@ -544,7 +544,7 @@ var _ = Describe("Supervisor E2E Testing", func() { stopCh := make(chan bool) errCh := make(chan bool, 2) - target := metav1.GroupKind{Group: kubedbapi.SchemeGroupVersion.Group, Kind: kubedbapi.ResourceKindMongoDB} + target := metav1.GroupKind{Group: kubedbv1.SchemeGroupVersion.Group, Kind: kubedbv1.ResourceKindMongoDB} ensureQueuePerTargetParallelism(stopCh, errCh, target, f.Namespace()) waitingForRecommendationToBeSucceeded(rcmd1Key)