ApplicationSet generator CLI tool to validate the resource output #9904
agaudreault
started this conversation in
Ideas
Replies: 2 comments
-
Updating this since that #9584 is merged |
Beta Was this translation helpful? Give feedback.
0 replies
-
Extended discussion here: #10895 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
One of the problem we have with ApplicationSet is the ability to test the generators before to commit/apply the yaml in the cluster.
Context
We have the apps-of-appsets pattern where we have a global
application-sync
responsible to sync a folder in a Git repository with multiple ApplicationSet manifests. Before a user commit to the Git repository, we would like to perform a validation of what the generators will return.This is quite important, especially when you do not use
preserveResourcesOnDeletion
, because an error or a typo in the generator would mean that your Application is deleted, and all associated resources with it.A solution to prevent that is to have
--policy create-update
option enabled, but this causes a lot of manual actions whenever the generator result changes and would not be suitable for us at scale.Solution
A solution would be to give developers a tool to validate the result of their generator
Example
With the following file,
A user (or a CI) would be able to run a CLI command, curl or something like that locally, and it would return the list of item that the generator would iterate upon, such as
> argocd appset get-items -f ./test-appset.yaml foo-dev-cluster-1 foo-dev-cluster-2 foo-staging-cluster-1
Another feature could be to have a command similar to helm template to be able to generate the resulting YAML. With the example above, it would generate the template of the 3 applications, with the values interpolated if any.
Beta Was this translation helpful? Give feedback.
All reactions