applicationset
applicationset copied to clipboard
Add the ability to exclude files when using the git file generator
When using the git directory generator it is possible to exclude specific paths like this
- git:
repoURL: https://github.com/argoproj-labs/applicationset.git
revision: HEAD
directories:
- path: examples/git-generator-directory/excludes/cluster-addons/*
- path: examples/git-generator-directory/excludes/cluster-addons/exclude-helm-guestbook
exclude: true
When using the git file generator I would like to be able to add files using a wildcard and then exclude specific files like this
spec:
generators:
- git:
repoURL: https://github.com/argoproj-labs/applicationset.git
revision: HEAD
files:
- path: "examples/git-generator-files-discovery/cluster-config/**/config.json"
- path "examples/git-generator-files-discovery/cluster-config/staging/config.json"
exclude: true
Of course if there is another way to do this that I am not aware of then I would be happy to use that. If not I am also happy to implement this change if it is agreed.
@adamjohnson01 I'm not aware of a workaround. Would you be willing to contribute the feature?
@crenshaw-dev yes I am happy to contribute.
i need same feature, @adamjohnson01 you make this chances? if not call for me i write this.
@templarfelix, I have this working. Will create a PR soon.
Will this feature also support exclude directories like /foo/**
or /foo
in the git files generator?
Will this feature also support exclude directories like
/foo/**
or/foo
in the git files generator?
Neither /foo/*
or /foo
would not work as the file list does not contain a full path. It is the output of git ls-files
foo/**
would work but foo
would not as the entire path needs to match. There needs to be either a **
or any pattern that is accepted by path.Match
pattern:
{ term }
term:
'*' matches any sequence of non-/ characters
'?' matches any single non-/ character
'[' [ '^' ] { character-range } ']'
character class (must be non-empty)
c matches character c (c != '*', '?', '\\', '[')
'\\' c matches character c
character-range:
c matches character c (c != '\\', '-', ']')
'\\' c matches character c
lo '-' hi matches character c for lo <= c <= hi
Any updates on this? For me this would simplify the definition of ApplicationSets a lot
@DjoleLepi I'm not sure if this PR was ever moved over to argoproj/argo-cd after applicationset was integrated with that repo.
HI that would great to have this feature