feat: delete previously created resources that are no longer needed
AmitKumarDas opened this issue · comments
Amit Kumar Das commented
ProblemStatement: As a SRE admin, I would like to delete outdated resources that were created via Recipe tasks. I want to avoid creating new Recipe(s) to delete unused ones.
Amit Kumar Das commented
Draft design
- Consider below Recipe was applied previously
kind: Recipe
metadata:
name: auto
namespace: reconcile
spec:
deleteUnused: true # tunable to handle this feature
tasks:
- name:
create:
state:
kind: Pod
metadata:
name: hello
name: there
- name:
apply:
state:
kind: ConfigMap
metadata:
name: hello
name: there
- Above Recipe was modified as follows:
kind: Recipe
metadata:
name: auto
namespace: reconcile
spec:
deleteUnused: true # tunable to handle this feature
tasks:
- name:
apply:
state:
kind: ConfigMap
metadata:
name: hello
name: there
- Above should lead to deletion of Pod that was created earlier by this Recipe