Open WillooWisp opened 3 years ago
Thanks for the detailed example and explanation, very helpful for visualizing your question. I can't think of a way to do that with the current matrix generator as it exists, but I can definitely see how that would be useful.
Just brainstorming off the top of my head here, not committing to any changes :smile:, but here's a pseudo-example where I could see it working something like this:
generators:
- matrix:
generators:
- git:
repoURL: git@github.com:Connectitude/iot-infra-k8s.git
revision: feature/applicationset
directories:
- path: "applicationset/cluster-addons/*"
paramPrefix: git_directory. # 'paramPrefix' idea from 236
- git:
repoURL: git@github.com:Connectitude/iot-infra-k8s.git
revision: feature/applicationset
files:
- path: "applicationset/cluster-configs/*.json"
paramPrefix: git_file.
# Combine sets of parameters using the matrix generator as usual, BUT only output a set of parameters
# if it meets this criteria:
emitParameterIf: # (or maybe call this field join?)
operandA: git_directory.path.basename
operator: =
operandB: git_file.config_file.path.basename # new parameters a bit like 258
Which would depend on at least a few other features being implemented:
So this would still generate every combinaton of parameters between the two generators, BUT it would only emit ones (to the template) that match a specified condition (eg a join). That way applications within the Git directory folder would get matched against corresponding config.json paths.
Is this supported in anyway now?
Is this a supported feature now?
I started experimenting with the matrix generator, in hope of combining the directory generator with a config file per directory, e.g. making it possible to have a specific config.json file per application to generate to be able to specify specific namespace per application, or specific sync settings per application. Is this possible somehow?