Skip to content

Commit

Permalink
Fixed merge-conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekdwivedi3060 committed Aug 14, 2024
1 parent 40b47f9 commit b3c72c3
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions test/cluster/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,20 @@ func isClusterStateValid(
return false
}

// Validate status
statusToSpec, err := asdbv1.CopyStatusToSpec(&newCluster.Status.AerospikeClusterStatusSpec)
if err != nil {
pkgLog.Error(err, "Failed to copy spec in status", "err", err)
return false
}
// Do not compare status with spec if cluster reconciliation is paused
// `paused` flag only exists in the spec and not in the status.
if !asdbv1.GetBool(aeroCluster.Spec.Paused) {
// Validate status
statusToSpec, err := asdbv1.CopyStatusToSpec(&newCluster.Status.AerospikeClusterStatusSpec)
if err != nil {
pkgLog.Error(err, "Failed to copy spec in status", "err", err)
return false
}

if !reflect.DeepEqual(statusToSpec, &newCluster.Spec) {
pkgLog.Info("Cluster status is not matching the spec")
return false
if !reflect.DeepEqual(statusToSpec, &newCluster.Spec) {
pkgLog.Info("Cluster status is not matching the spec")
return false
}
}

// TODO: This is not valid for tests where maxUnavailablePods flag is used.
Expand All @@ -136,6 +140,8 @@ func isClusterStateValid(
aeroCluster.Spec.Image,
),
)

return false
}

if newCluster.Labels[asdbv1.AerospikeAPIVersionLabel] != asdbv1.AerospikeAPIVersion {
Expand Down

0 comments on commit b3c72c3

Please sign in to comment.