Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Fix controlplane components order #937

Merged
merged 2 commits into from
Sep 11, 2020

Conversation

knrt10
Copy link
Member

@knrt10 knrt10 commented Sep 10, 2020

Also, added test to check the order

Closes #918

Signed-off-by: knrt10 <kautilya@kinvolk.io>
Signed-off-by: knrt10 <kautilya@kinvolk.io>
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense

func TestCommonControlPlaneChartsOrder(t *testing.T) {
expectedOrder := []string{"pod-checkpointer", "kube-apiserver", "kubernetes", "calico", "lokomotive", "bootstrap-secrets"} //nolint:lll

commonControlPlaneCharts := platform.CommonControlPlaneCharts()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooking on platform.CommonControlPlaneCharts is not the ideal place to check that, as the order may still be mangled by appending to the slice or even randomized before applying, but I think it's better than nothing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that new charts might be appended in the list. Like it is don for kubelet chart. But I don't know if the order will change as you say so. I see it is all ordered from there on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is, we do not check right before the applying, so it still can be mangled somewhere.

@@ -45,3 +46,19 @@ func TestAppendVersionTag(t *testing.T) {
t.Fatalf("should append version tag to existing map")
}
}

func TestCommonControlPlaneChartsOrder(t *testing.T) {
expectedOrder := []string{"pod-checkpointer", "kube-apiserver", "kubernetes", "calico", "lokomotive", "bootstrap-secrets"} //nolint:lll
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Topic for other issue probably, but most likely bootstrap-secrets should be applied even before pod-checkpointer, so nodes can join the cluster for pod-checkpointer to converge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we check if the worker nodes are up before applying bootstrap-secrets it will still fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but that's a separate issue :)

Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@knrt10 knrt10 merged commit ee24a63 into master Sep 11, 2020
@knrt10 knrt10 deleted the knrt10/update-controlplane-components-order branch September 11, 2020 06:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"lokoctl cluster apply" updates controlplane components in wrong order
3 participants