[feature request] Support `score-compose resources deprovision` subcommand
The statefile and provisioners will happily create any resources referenced by the Score spec, however, these resources are not cleaned up if they are no longer referenced!
We need to add support for:
- After
generatelog a warning message indicating any resources in the statefile that are no longer used in the workload. - Indicate these "left over" resources in the
score-compose resources listtable. - Support a
deprovisionsubcommand which calls the provisioner with theDELETEaction and waits for the provisioner to return before removing it from the state file.
There is a similar issue open in score-k8s.
Hello @astromechza , I would like to contribute to this issue ?
would like to work on this!
@rabelmervin / @7h3-3mp7y-m4n either of you are welcome to put up a PR :)
@astromechza @mathieu-benoit I would like to wok on this.
Hey @Yadavanurag13,
For sure you can work on it :)
I was initially working on this, but lost track of time. Here's the actual issue I found:
The state.yaml file and the provisioners will happily create any resources referenced by the Score spec. However, if those resources are later removed from the spec, they are not cleaned up — they remain in state.yaml file
How to reproduce the issue:
- Create a simple
score.yamlfile with some resources and generate it. (You can see thestate.yamlto catch it ) - Remove one or more of the resources from
score.yaml. - Run generate again.
- You'll notice that the removed resources are still present in the state.yaml, even though they are no longer part of the spec.
I'll go ahead and close my draft PR. If you need any help, we're all here to support you! 🙂