score-compose icon indicating copy to clipboard operation
score-compose copied to clipboard

[feature request] Support `score-compose resources deprovision` subcommand

Open astromechza opened this issue 9 months ago • 5 comments

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:

  1. After generate log a warning message indicating any resources in the statefile that are no longer used in the workload.
  2. Indicate these "left over" resources in the score-compose resources list table.
  3. Support a deprovision subcommand which calls the provisioner with the DELETE action and waits for the provisioner to return before removing it from the state file.

There is a similar issue open in score-k8s.

astromechza avatar Apr 02 '25 09:04 astromechza

Hello @astromechza , I would like to contribute to this issue ?

rabelmervin avatar Apr 04 '25 17:04 rabelmervin

would like to work on this!

7h3-3mp7y-m4n avatar Apr 09 '25 22:04 7h3-3mp7y-m4n

@rabelmervin / @7h3-3mp7y-m4n either of you are welcome to put up a PR :)

astromechza avatar Jul 03 '25 10:07 astromechza

@astromechza @mathieu-benoit I would like to wok on this.

yanurag-dev avatar Jul 13 '25 12:07 yanurag-dev

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.yaml file with some resources and generate it. (You can see the state.yaml to 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! 🙂

7h3-3mp7y-m4n avatar Jul 13 '25 16:07 7h3-3mp7y-m4n