Skip to content

Commit

Permalink
Merge pull request #1138 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1087-to-release-4.14

[release-4.14] OCPBUGS-21802: remove revision stability check from bootstrap complet…
  • Loading branch information
openshift-merge-bot[bot] committed Nov 8, 2023
2 parents 578c952 + 4e47678 commit d2309e2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 45 deletions.
8 changes: 1 addition & 7 deletions pkg/operator/ceohelpers/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,14 @@ func IsBootstrapComplete(configMapClient corev1listers.ConfigMapLister, staticPo
return false, nil
}

// now run check to stability of revisions
_, status, _, err := staticPodClient.GetStaticPodOperatorState()
if err != nil {
return false, fmt.Errorf("failed to get static pod operator state: %w", err)
}

if status.LatestAvailableRevision == 0 {
return false, nil
}
for _, curr := range status.NodeStatuses {
if curr.CurrentRevision != status.LatestAvailableRevision {
klog.V(4).Infof("bootstrap considered incomplete because revision %d is still in progress", status.LatestAvailableRevision)
return false, nil
}
}

// check if etcd-bootstrap member is still present within the etcd cluster membership
membersList, err := etcdClient.MemberList(context.Background())
Expand Down
7 changes: 0 additions & 7 deletions pkg/operator/ceohelpers/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@ func Test_IsBootstrapComplete(t *testing.T) {
expectComplete: true,
expectError: nil,
},
"bootstrap complete, node progressing": {
bootstrapConfigMap: bootstrapComplete,
nodes: twoNodesProgressingTowardsCurrentRevision,
etcdMembers: u.DefaultEtcdMembers(),
expectComplete: false,
expectError: nil,
},
"bootstrap complete, etcd-bootstrap removed": {
bootstrapConfigMap: bootstrapComplete,
nodes: twoNodesAtCurrentRevision,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,37 +135,6 @@ func TestBootstrapAnnotationRemoval(t *testing.T) {
}
},
},
{
// The configmap should remain intact because although bootstrapping
// reports complete, the nodes are still progressing towards a revision.
name: "NewClusterBootstrapNodesProgressing",
objects: []runtime.Object{
u.BootstrapConfigMap(u.WithBootstrapStatus("complete")),
u.EndpointsConfigMap(
u.WithBootstrapIP("192.0.2.1"),
u.WithEndpoint(etcdMembers[0].ID, etcdMembers[0].PeerURLs[0]),
u.WithEndpoint(etcdMembers[1].ID, etcdMembers[1].PeerURLs[0]),
u.WithEndpoint(etcdMembers[2].ID, etcdMembers[2].PeerURLs[0]),
),
},
staticPodStatus: u.StaticPodOperatorStatus(
u.WithLatestRevision(3),
u.WithNodeStatusAtCurrentRevision(3),
u.WithNodeStatusAtCurrentRevision(2),
u.WithNodeStatusAtCurrentRevision(3),
),
expectBootstrap: true,
etcdMembers: etcdMembers,
validateFunc: func(ts *testing.T, endpoints []func(*corev1.ConfigMap), actions []clientgotesting.Action) {
for _, action := range actions {
if action.Matches("update", "configmaps") {
updateAction := action.(clientgotesting.UpdateAction)
actual := updateAction.GetObject().(*corev1.ConfigMap)
ts.Errorf("unexpected configmap update: %#v", actual)
}
}
},
},
{
// The configmap should remain intact because although nodes appear
// to have converged on a revision, bootstrap reports incomplete.
Expand Down

0 comments on commit d2309e2

Please sign in to comment.