Add Kargo Promotion Step to Remove File and/or Directory #2860
Labels
area/controller
good first issue
Good issue for a new contributor to handle
help-wanted
Community help on this would be appreciated
kind/enhancement
needs/area
priority/normal
Checklist
kargo version
, if applicable.Proposed Feature
The promotion directives/steps introduced in Kargo v0.9 included a 'copy' step [1]. The 'copy' step would pair well with a 'remove' step to allow individual files and/or directories to be removed. The 'git-clear' step [2] is too broad for this purpose.
Motivation
With the potential that Kargo Render will be archived in the near future, I am hoping to use Kargo to manager cluster infrastructure configuration. I currently use Kargo Render to generate Git branches for each cluster following the Rendered Manifest Pattern. Each of these Git branches contains all of the infrastructure configuration (e.g. cert-manager, Kargo, Argo CD, etc) for a single cluster. An Argo CD ApplicationSet resource on a cluster points to matching branch.
Directory structure of
main
branch.Example of
main
branch.Directory structure of a cluster branch (e.g.
cluster/non-production
branch).Example of cluster branch.
If Kargo is configured with a separate pipeline for each component then the 'git-clear' step available within Kargo cannot be used because all of the other components are removed from the target branch containing the rendered manifests when one of the components changes.
Here is Kargo Render config that currently achieves the same outcome.
Suggested Implementation
Removes a single file if specified.
Removes an entire directory if no file is specified.
Example usage within a Kargo Stage for the cert-manager component. This would allow the cert-manager configuration to be removed without removing configuration for other components (e.g. Argo CD, Kargo, etc).
References
[1] https://docs.kargo.io/references/promotion-steps/#copy
[2] https://docs.kargo.io/references/promotion-steps/#git-clear
The text was updated successfully, but these errors were encountered: