Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Set maps in arrays from cli#452

Merged
bryanl merged 1 commit intoksonnet:masterfrom
bryanl:maps-in-arrays
Apr 17, 2018
Merged

Set maps in arrays from cli#452
bryanl merged 1 commit intoksonnet:masterfrom
bryanl:maps-in-arrays

Conversation

@bryanl
Copy link
Member

@bryanl bryanl commented Apr 17, 2018

Running:

ks param set my-service envs '[{"name": "value1"},{"name": "value2"}]'

Produces the following in params.libsonnet

{
  components: {
    "my-service": {
      envs: [{
        name: "value1",
      },{
        name: "value2",
      }],
    },
  },
}

Fixes #448

Signed-off-by: bryanl bryanliles@gmail.com

Running:

```
ks param set my-service envs '[{"name": "value1"},{"name": "value2"}]'
```

Produces the following in params.libsonnet

```json
{
  components: {
    "my-service": {
      envs: [{
        name: "value1",
      },{
        name: "value2",
      }],
    },
  },
}
```

Fixes ksonnet#448

Signed-off-by: bryanl <bryanliles@gmail.com>
@bryanl bryanl merged commit a77a1a2 into ksonnet:master Apr 17, 2018
@bryanl bryanl deleted the maps-in-arrays branch April 17, 2018 15:59
@jsakai
Copy link

jsakai commented Apr 17, 2018

@bryanl Thank you for your quick response. I used latest mater branch but I got different error message below:

$ ks param set search-v1 envs '[{"name":"value1"},{"name":"value2"}]'
ERROR set param: convert params to object: convert value to noder: unsupported type map[string]interface {}

$ ks version
ksonnet version: dev-2018-04-17T09:17:59-0700
jsonnet version: v0.10.0
client-go version: 1.8

Am I doing wrong?

@bryanl
Copy link
Member Author

bryanl commented Apr 17, 2018

Try pulling master again. as of a77a1a2, it appears to work fine.

2018-04-17_12-51-10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants