Skip to content

Commit

Permalink
Use kubedb v1 api
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Sep 16, 2024
1 parent f9bdcb9 commit 591429b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}

Expand Down
10 changes: 5 additions & 5 deletions test/e2e/framework/recommendation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
14 changes: 7 additions & 7 deletions test/e2e/recommendation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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())
Expand Down Expand Up @@ -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{
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 591429b

Please sign in to comment.