Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
fix migration issue (#328)
Browse files Browse the repository at this point in the history
Signed-off-by: ldpliu <[email protected]>
  • Loading branch information
ldpliu authored Feb 28, 2023
1 parent 5b5c587 commit bf0eeb0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ var (
}

// removed CRD StoredVersions
removedCRDStoredVersions = map[string]string{
"managedclustersets.cluster.open-cluster-management.io": "v1beta1",
"managedclustersetbindings.cluster.open-cluster-management.io": "v1beta1",
}
removedCRDStoredVersions = map[string]string{}
)

type crdReconcile struct {
Expand Down
35 changes: 0 additions & 35 deletions test/e2e/clusterset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import (
clusterv1beta2 "open-cluster-management.io/api/cluster/v1beta2"
)

const (
clustersetCrdName = "managedclustersets.cluster.open-cluster-management.io"
clustersetBindingCrdName = "managedclustersetbindings.cluster.open-cluster-management.io"
)

var _ = ginkgo.Describe("Create v1beta2 managedclusterset", func() {
ginkgo.It("Create a v1beta2 labelselector based ManagedClusterSet and get/update/delete with v1beta2 client", func() {
ginkgo.By("Create a v1beta2 ManagedClusterSet")
Expand Down Expand Up @@ -118,34 +113,4 @@ var _ = ginkgo.Describe("Create v1beta2 managedclusterset", func() {
err := t.ClusterClient.ClusterV1beta1().ManagedClusterSets().Delete(context.Background(), managedClusterSetName, metav1.DeleteOptions{})
gomega.Expect(err).ToNot(gomega.HaveOccurred())
})
ginkgo.It("Check if the v1beta1 storageversion is removed from clusterset crd", func() {
gomega.Eventually(func() error {
clustersetCrd, err := t.HubAPIExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Get(context.Background(), clustersetCrdName, metav1.GetOptions{})
if err != nil {
return err
}
if len(clustersetCrd.Status.StoredVersions) != 1 {
return fmt.Errorf("clustersetCrd.Status.StoredVersions should be v1beta2, but got:%v", clustersetCrd.Status.StoredVersions)
}
if clustersetCrd.Status.StoredVersions[0] != "v1beta2" {
return fmt.Errorf("clustersetCrd.Status.StoredVersions should be v1beta2, but got:%v", clustersetCrd.Status.StoredVersions)
}
return nil
}, t.EventuallyTimeout*5, t.EventuallyInterval*5).Should(gomega.Succeed())
})
ginkgo.It("Check if the v1beta1 storageversion is removed from clustersetbinding crd", func() {
gomega.Eventually(func() error {
clustersetBindingCrd, err := t.HubAPIExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Get(context.Background(), clustersetBindingCrdName, metav1.GetOptions{})
if err != nil {
return err
}
if len(clustersetBindingCrd.Status.StoredVersions) != 1 {
return fmt.Errorf("clustersetBindingCrd.Status.StoredVersions should be v1beta2, but got:%v", clustersetBindingCrd.Status.StoredVersions)
}
if clustersetBindingCrd.Status.StoredVersions[0] != "v1beta2" {
return fmt.Errorf("clustersetBindingCrd.Status.StoredVersions should be v1beta2, but got:%v", clustersetBindingCrd.Status.StoredVersions)
}
return nil
}, t.EventuallyTimeout*5, t.EventuallyInterval*5).Should(gomega.Succeed())
})
})

0 comments on commit bf0eeb0

Please sign in to comment.