cloudfoundry/bosh-cli

Array replacement/add operation and value completion operation do not work

kei-yamazaki opened this issue · 3 comments

I created an ops file that performs array adding operation after array replacement for the following array.

$ cat array.yml
---
array:
- 1
- 2
- 3
$ cat ops-without-value.yml
---
- type: replace
  path: /array
  value:
  - 0

- type: replace
  path: /array/-
  value: 99

The above ops file works as expected.

$ bosh int array.yml -o ops-without-value.yml
array:
- 0
- 99

But when I use value completion as part of the ops file, it doesn't work as expected.

$ cat ops-with-value.yml
---
- type: replace
  path: /array
  value: ((value))

- type: replace
  path: /array/-
  value: 99
$ cat values.yml
---
value:
- 0
$ bosh int array.yml -o ops-with-value.yml -l values.yml
Error 'operation [1] in ops-with-value.yml failed': Expected to find an array at path '/array/-' but found 'string'

Exit code 1

I'm guessing that bosh-cli is trying to add to the array before completing the ((value)) with the specified value.

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/173787014

The labels on this github issue will be updated when the story is started.

This issue was marked as Stale because it has been open for 21 days without any activity. If no activity takes place in the coming 7 days it will automatically be close. To prevent this from happening remove the Stale label or comment below.

This issue was closed because it has been labeled Stale for 7 days without subsequent activity. Feel free to re-open this issue at any time by commenting below.