File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ func distributionFromLabels(clientset kubernetes.Interface) types.Distribution {
8181 if k == "minikube.k8s.io/version" {
8282 return types .Minikube
8383 }
84+ if k == "kots.io/embedded-cluster-role" {
85+ return types .EmbeddedCluster
86+ }
8487 }
8588 }
8689 return types .UnknownDistribution
Original file line number Diff line number Diff line change @@ -163,6 +163,23 @@ func TestGetDistribution(t *testing.T) {
163163 },
164164 want : types .Minikube ,
165165 },
166+ {
167+ name : "embedded-cluster from labels" ,
168+ args : args {
169+ clientset : mockClientsetForDistribution (& mockClientsetForDistributionOpts {
170+ objects : []runtime.Object {
171+ & corev1.Node {
172+ ObjectMeta : metav1.ObjectMeta {
173+ Labels : map [string ]string {
174+ "kots.io/embedded-cluster-role" : "total-1" ,
175+ },
176+ },
177+ },
178+ },
179+ }),
180+ },
181+ want : types .EmbeddedCluster ,
182+ },
166183 {
167184 name : "gke from version" ,
168185 args : args {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const (
1212 AKS
1313 DigitalOcean
1414 EKS
15+ EmbeddedCluster
1516 GKE
1617 K0s
1718 K3s
@@ -46,6 +47,8 @@ func (d Distribution) String() string {
4647 return "digital-ocean"
4748 case EKS :
4849 return "eks"
50+ case EmbeddedCluster :
51+ return "embedded-cluster"
4952 case GKE :
5053 return "gke"
5154 case K0s :
You can’t perform that action at this time.
0 commit comments