-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow interpolation of cluster generator values (#9254)
* feat: allow interpolation of generator values Allow the interpolation of `values` found in the cluster generator. This allows interpolation of `{{name}}`, `{{server}}`, `{{metadata.labels.*}}` and `{{metadata.annotations.*}}`. See argoproj/applicationset#371. This interpolation could potentially be extended to the list and duck-type generators if desired. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * docs: add values interpolation usage instructions Add a basic example of how values interpolation can be used with the cluster generator. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * fix: remove billion-laughs attack vector The previous implementation was vulnerable to a billion-laughs attack, where someone could interpolate values based upon other values, something like: ```yaml values: lol1: lol lol2: '{{values.lol1}}{{values.lol1}}' # lol3: '{{values.lol2}}{{values.lol2}}{{values.lol2}}{{values.lol2}}' ``` To counteract that, instead of directly manipulating the `params` map, we create a map to keep track of the interpolated values, and only template the values which have been previously whitelisted. Once we go through all the values, we then merge the interpolated values map back to the `params` map. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
- Loading branch information
1 parent
9d4c940
commit a041bf8
Showing
4 changed files
with
107 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters