Skip to content

Commit

Permalink
Add support for yaml-anchors in chart ChartSpec.ValuesYaml
Browse files Browse the repository at this point in the history
yaml.v3 unmarshals to map[interface{}]interface{} if using yaml-anchors.
Because helm converts yaml to json we have to unmarshal to map[string]interface{} instead of map[interface{}]interface{}.
To achieve this we simply replace the yaml provider "gopkg.in/yaml.v3" with "sigs.k8s.io/yaml".

For more details see go-yaml/yaml#139
  • Loading branch information
jkmw committed Jun 2, 2020
1 parent 976e72f commit 7ff4155
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/golang/mock v1.4.3
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
helm.sh/helm/v3 v3.1.2
k8s.io/apiextensions-apiserver v0.17.2
k8s.io/apimachinery v0.17.2
k8s.io/cli-runtime v0.17.2
k8s.io/client-go v0.17.2
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/yaml v1.1.0
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,6 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
helm.sh/helm/v3 v3.1.2 h1:VpNzaNv2DX4aRnOCcV7v5Of+XT2SZrJ8iOQ25AGKOos=
Expand Down
2 changes: 1 addition & 1 deletion spec.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package helmclient

import (
"gopkg.in/yaml.v3"
"sigs.k8s.io/yaml"
)

// GetValuesMap returns the mapped out values of a chart
Expand Down

0 comments on commit 7ff4155

Please sign in to comment.