Challenges with setting namespace when using generators #2466
Labels
area/fn-sdk
Typescript SDK
area/hydrate
enhancement
New feature or request
p1
triaged
Issue has been triaged by adding an `area/` label
Describe your problem
I am trying to write a generator function. Basically it inserts some data into a configmap, nothing too fancy.
My Kptfile looks like:
My function generates a new config, and inserts it into the list of items with merging:
The problem is that the generator doesn't add a namespace, but then it later is added. This means that the second run of the pipeline ends up appending the config again - so we end up with 2x copies.
Possible solutions:
namespace
param, and all usages to set it as well - a lot of churn and duplication.configMap
is used, set the namespace equal to that of the Kptfile namespace. Bonus points ifset-namespace
also uses this. Then, the whole Kptfile could look like:To get the namespace that should be used, functions can use
rl.FunctionConfig.GetNamespace()
The text was updated successfully, but these errors were encountered: