kops: kops toolbox template: Incorrect interpolation of arrays from values yaml

1. What kops version are you running? The command kops version, will display this information.

Version 1.11.0

2. What commands did you run? What is the simplest way to reproduce this issue?

kops toolbox template --values values.yaml --template def.yaml

def.yaml:

apiVersion: kops/v1alpha2
kind: Cluster
spec:
  kubernetesApiAccess: {{.allowedIPs}}

values.yaml:

allowedIPs:
- 1.2.3.4/32
- 4.3.2.1/32

3. What happened after the commands executed?

apiVersion: kops/v1alpha2
kind: Cluster
spec:
  kubernetesApiAccess: [1.2.3.4/32 4.3.2.1/32]

4. What did you expect to happen?

The interpolated array in the resulting yaml should contain commas to make it a proper yaml array. The way that it’s outputting the array in the interpolated outputted yaml is incorrect.

5. Any other information?

This also happens when using the --set or --set-string flag with an array as documented in HERE, making the documentation incorrect due to this bug.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 27 (9 by maintainers)

Most upvoted comments

I’ve come across the same thing, for exactly the same need 😃

My 2c is that it would be great if kops toolbox template would have a toYaml function just like helm does. This is the helm implementation PR: https://github.com/helm/helm/pull/1230

/reopen

this is still an issue

@hhaslam11: You can’t reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

still having this issue in 1.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.