Skip to content

Commit

Permalink
chore: remove InstanceSet dependency from cluster_controller_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
free6om committed Apr 24, 2024
1 parent 8194d22 commit 2212309
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions controllers/apps/cluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (

appsv1alpha1 "github.com/apecloud/kubeblocks/apis/apps/v1alpha1"
dpv1alpha1 "github.com/apecloud/kubeblocks/apis/dataprotection/v1alpha1"
workloads "github.com/apecloud/kubeblocks/apis/workloads/v1alpha1"
"github.com/apecloud/kubeblocks/pkg/constant"
"github.com/apecloud/kubeblocks/pkg/controller/builder"
"github.com/apecloud/kubeblocks/pkg/controller/component"
Expand Down Expand Up @@ -380,17 +379,14 @@ var _ = Describe("Cluster Controller", func() {
Namespace: clusterObj.Namespace,
Name: constant.GenerateClusterComponentName(clusterObj.Name, compName),
}
Eventually(testapps.CheckObjExists(&testCtx, compKey, &appsv1alpha1.Component{}, true)).Should(Succeed())
compObj := &appsv1alpha1.Component{}
Eventually(testapps.CheckObjExists(&testCtx, compKey, compObj, true)).Should(Succeed())

By("Wait InstanceSet created")
itsKey := compKey
its := &workloads.InstanceSet{}
Eventually(testapps.CheckObjExists(&testCtx, itsKey, its, true)).Should(Succeed())
Eventually(testapps.CheckObj(&testCtx, clusterKey, func(g Gomega, cluster *appsv1alpha1.Cluster) {
g.Expect(cluster.Spec.ComponentSpecs).Should(HaveLen(1))
clusterJSON, err := json.Marshal(cluster.Spec.ComponentSpecs[0].Instances)
g.Expect(err).Should(BeNil())
itsJSON, err := json.Marshal(its.Spec.Instances)
itsJSON, err := json.Marshal(compObj.Spec.Instances)
g.Expect(err).Should(BeNil())
g.Expect(clusterJSON).Should(Equal(itsJSON))
})).Should(Succeed())
Expand Down

0 comments on commit 2212309

Please sign in to comment.