Skip to content

Commit

Permalink
fix getK8sImageVersionFromValues; make image lookup order-agnostic (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerGillson authored Aug 14, 2023
1 parent 09410bc commit ff78a01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/vclustervalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ff78a01

Please sign in to comment.