Add test for checking order of controlplane charts
package platform_test
import (
+ "reflect"
"testing"
"github.com/kinvolk/lokomotive/pkg/platform"
@@ -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)
+ }
+}
