cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

`bosh delete-stemcell` should error-out when passed the "OS/Version" instead of the "Name/Version" #95

Closed cunnie closed 7 years ago

cunnie commented 7 years ago

bosh delete-stemcell should error-out when passed the OS/Version in lieu of the Name/Version. Instead, it indicates it has deleted the stemcell, but the stemcell has not been deleted:

bosh --version; bosh stemcells; \
  bosh -n delete-stemcell ubuntu-trusty/3262.2; \
  bosh -n delete-stemcell ubuntu-trusty/3262.5; \
  bosh stemcells

version 0.0.25-daaed40-2016-08-15T18:49:02Z

Exit code 1
Using environment 'bosh-gce.nono.io' as user 'admin'

Name                                    Version  OS             CID
bosh-google-kvm-ubuntu-trusty-go_agent  3262.5   ubuntu-trusty  stemcell-457951f6-0f9c-4b67-6d03-458b83bd6b29
~                                       3262.2   ubuntu-trusty  stemcell-fb1657ee-d9fe-47d0-72b0-0e46f5286e26

(*) Currently deployed

2 stemcells

Succeeded
Using environment 'bosh-gce.nono.io' as user 'admin'

Succeeded
Using environment 'bosh-gce.nono.io' as user 'admin'

Succeeded
Using environment 'bosh-gce.nono.io' as user 'admin'

Name                                    Version  OS             CID
bosh-google-kvm-ubuntu-trusty-go_agent  3262.5   ubuntu-trusty  stemcell-457951f6-0f9c-4b67-6d03-458b83bd6b29
~                                       3262.2   ubuntu-trusty  stemcell-fb1657ee-d9fe-47d0-72b0-0e46f5286e26

(*) Currently deployed

2 stemcells

Succeeded
cppforlife commented 7 years ago

@cunnie this idempotent behaviour of the cli.