You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add test for CPMS OnDelete strategy with full master replacement
Creates a new test case that validates the ControlPlaneMachineSet OnDelete
strategy by deleting all three master machines simultaneously and verifying
CPMS correctly replaces them while maintaining cluster health.
The test switches CPMS to OnDelete strategy, deletes all master machines,
and validates that CPMS creates replacements with proper etcd membership
transitions. Verifies that all old etcd members are removed from both the
cluster and etcd-endpoints ConfigMap, and new members are properly integrated.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
framework.Logf("Waiting up to %s for the cluster to have %v voting members with none from the excluded list: %v", waitPollTimeout.String(), expectedCount, excludedMemberNames)
// Convert member ID to hexadecimal format to match etcd-endpoints ConfigMap format
503
+
memberID:=fmt.Sprintf("%x", member.ID)
504
+
excludedMemberIDs.Insert(memberID)
505
+
}
506
+
}
507
+
}
508
+
509
+
// Check if we have the expected count
510
+
iflen(votingMemberNames) !=expectedCount {
511
+
framework.Logf("unexpected number of voting etcd members, expected exactly %d, got: %v, current members are: %v", expectedCount, len(votingMemberNames), votingMemberNames)
512
+
returnfalse, nil
513
+
}
514
+
515
+
// Check if any of the current members are in the excluded list
516
+
for_, memberName:=rangevotingMemberNames {
517
+
ifexcludedSet.Has(memberName) {
518
+
framework.Logf("found excluded member %q still in the cluster, current members are: %v", memberName, votingMemberNames)
519
+
returnfalse, nil
520
+
}
521
+
}
522
+
523
+
framework.Logf("cluster has reached the expected number of %v voting members with none from excluded list, current members are: %v", expectedCount, votingMemberNames)
524
+
525
+
// Also validate etcd-endpoints ConfigMap
526
+
framework.Logf("ensuring that the openshift-etcd/etcd-endpoints cm has the expected number of %v voting members and excludes old members", expectedCount)
framework.Logf("unexpected number of voting members in the openshift-etcd/etcd-endpoints cm, expected exactly %d, got: %v, current members are: %v", expectedCount, currentVotingMemberIPListSet.Len(), currentVotingMemberIPListSet.List())
542
+
returnfalse, nil
543
+
}
544
+
545
+
returntrue, nil
546
+
})
547
+
}
548
+
388
549
// EnsureVotingMembersCount counts the number of voting etcd members, it doesn't evaluate health conditions or any other attributes (i.e. name) of individual members
389
550
// this method won't fail immediately on errors, this is useful during scaling down operation until the feature can ensure this operation to be graceful
0 commit comments