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

Commit

Permalink
Merge pull request #937 from kinvolk/knrt10/update-controlplane-compo…
Browse files Browse the repository at this point in the history
…nents-order

Fix controlplane components order
  • Loading branch information
knrt10 authored Sep 11, 2020
2 parents 2c42f34 + 468a554 commit ee24a63
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
func CommonControlPlaneCharts() []helm.LokomotiveChart {
return []helm.LokomotiveChart{
{
Name: "calico",
Name: "pod-checkpointer",
Namespace: "kube-system",
},
{
Expand All @@ -43,7 +43,7 @@ func CommonControlPlaneCharts() []helm.LokomotiveChart {
Namespace: "kube-system",
},
{
Name: "pod-checkpointer",
Name: "calico",
Namespace: "kube-system",
},
{
Expand Down
17 changes: 17 additions & 0 deletions pkg/platform/platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package platform_test

import (
"reflect"
"testing"

"github.com/kinvolk/lokomotive/pkg/platform"
Expand Down Expand Up @@ -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

commonControlPlaneCharts := platform.CommonControlPlaneCharts()

actualOrder := []string{}

for _, v := range commonControlPlaneCharts {
actualOrder = append(actualOrder, v.Name)
}

if !reflect.DeepEqual(actualOrder, expectedOrder) {
t.Fatalf("expected order: %s, got: %s", expectedOrder, actualOrder)
}
}

0 comments on commit ee24a63

Please sign in to comment.