Skip to content

Commit

Permalink
fixing testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja committed Apr 3, 2024
1 parent 53aa9ca commit ce05234
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions api/v1/aerospikecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,9 @@ func CopySpecToStatus(spec *AerospikeClusterSpec) (*AerospikeClusterStatusSpec,
}

if len(spec.K8sNodeBlockList) != 0 {
k8sNodeBlockList := lib.DeepCopy(&spec.K8sNodeBlockList).([]string)
k8sNodeBlockList := lib.DeepCopy(&spec.K8sNodeBlockList).(*[]string)

status.K8sNodeBlockList = k8sNodeBlockList
status.K8sNodeBlockList = *k8sNodeBlockList
}

return &status, nil
Expand Down Expand Up @@ -1086,8 +1086,8 @@ func CopyStatusToSpec(status *AerospikeClusterStatusSpec) (*AerospikeClusterSpec
}

if len(status.K8sNodeBlockList) != 0 {
k8sNodeBlockList := lib.DeepCopy(&status.K8sNodeBlockList).([]string)
spec.K8sNodeBlockList = k8sNodeBlockList
k8sNodeBlockList := lib.DeepCopy(&status.K8sNodeBlockList).(*[]string)
spec.K8sNodeBlockList = *k8sNodeBlockList
}

return &spec, nil
Expand Down
17 changes: 9 additions & 8 deletions test/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,15 @@ func clusterWithMaxIgnorablePod(ctx goctx.Context) {
}, 1*time.Minute).ShouldNot(HaveOccurred())

By("Upgrade version")
aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName)
Expect(err).ToNot(HaveOccurred())
newImage := baseImage + ":7.0.0.0_2"
aeroCluster.Spec.Image = newImage
// As pod is in pending state, CR object will be won't reach the final phase.
// So expectedPhases can be InProgress or Completed
err = updateClusterWithExpectedPhases(k8sClient, ctx, aeroCluster, expectedPhases)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
aeroCluster, err = getCluster(k8sClient, ctx, clusterNamespacedName)
Expect(err).ToNot(HaveOccurred())
newImage := baseImage + ":7.0.0.0_2"
aeroCluster.Spec.Image = newImage
// As pod is in pending state, CR object will be won't reach the final phase.
// So expectedPhases can be InProgress or Completed
return updateClusterWithExpectedPhases(k8sClient, ctx, aeroCluster, expectedPhases)
}, 1*time.Minute).ShouldNot(HaveOccurred())

By("Verify pending pod")
podList, err = getPodList(aeroCluster, k8sClient)
Expand Down

0 comments on commit ce05234

Please sign in to comment.