From ff78a011ea96ad9e14f76f76cfb3bc4205907e0d Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Mon, 14 Aug 2023 10:46:50 -0600 Subject: [PATCH] fix getK8sImageVersionFromValues; make image lookup order-agnostic (#13) --- pkg/util/vclustervalues/values.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/util/vclustervalues/values.go b/pkg/util/vclustervalues/values.go index 27b3e01f2..8a39279bc 100644 --- a/pkg/util/vclustervalues/values.go +++ b/pkg/util/vclustervalues/values.go @@ -98,9 +98,9 @@ func mergeMaps(a, b map[string]interface{}) map[string]interface{} { } func getK8sImageVersionFromValues(values string) string { - vclusterIdx := strings.Index(values, "vcluster:") // k0s, k3s + vclusterIdx := strings.Index(values, "vcluster:\n") // k0s, k3s if vclusterIdx == -1 { - vclusterIdx = strings.Index(values, "api:") // k8s, eks + vclusterIdx = strings.Index(values, "api:\n") // k8s, eks } imageAnchor := "image:" imageIdx := strings.Index(values[vclusterIdx:], imageAnchor)