-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlay configs for custom generators do not override base configs #1696
Comments
In the overlay, instead of adding
|
@Liujingfang1 Thank you. I tried that. The problem is it first runs the plugin with |
Is there any plan to support not running plugins until after their configs have been patched by overlays? |
I ended up in the same situation and try to play with the suggested answer with That is patching the |
@Liujingfang1 Additionally, unless you add This is quite the problem as various workarounds are all also problematic, and it seems like a common scenario for certain types of custom plugins. We need a way to patch plugin configs before the plugin gets run against them. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Running into the same issue. Any newer ways to resolve this ? |
@Aenima4six2 I ended up writing a transformer that executes a JQ filter, which suits my needs better as JQ is way more flexible. But it is more verbose as well. |
Yeah, I basically have my plugin YAML replicated across each kutomize override directory. Would be nice to perform a strategic merge patch override, so only the bits that change between environments need to be present, but we can live with this for now. |
This is an old closed issue but it came up when I was searching for the solution to this exact same problem. I'm therefore posting this here in case it helps anyone... Rather than duplicating the generator config, you can patch it if you use this sort of structure:
resources:
- ../../generators-base
patches:
- target:
kind: MyCustomGeneratorConfig
patch: |-
- op: replace
path: /some/path
value: something-specific-to-production
resources:
- ../base
generators:
- ./generator-config |
@hrobertson any chance you could update the example to show |
I'm using Kustomize 3.2.0.
It seems to be impossible to use a base/overlay setup for custom generator configs. Generator configs in overlays do not override generator configs in base, at least not prior to running the custom plugin. E.G.
Base (for a staging environment):
kustomization.yaml:
mySecretGetter.yaml:
Overlay (for a production environment):
kustomization.yaml:
mySecretGetter.yaml:
What I did:
kustomize build
the overlay.What happened:
secretsProjectID: 1234
.../../base
.1234
.What I expected to happen:
secretsProjectID: 5678
.Additional Notes
It's possible to move
mySecretGetter.yaml
into theresources
section in the base, and patch it in thepatches
section in the overlay before using it as a generator config, however this produces objects of kindSecretGetter
in the build output, as well as makes the base an incomplete configuration on it's own.The work-around I'm currently using is to use separate overlays, one for staging and one for production, and a Kustomize structure like the following. This is not ideal because the base is again not a complete configuration on it's own, and because it requires nearly identical complete copies of
mySecretGetter.yaml
, which deviates from Kustomize's base/overlay strategy.Staging Overlay (work-around):
Production Overlay (work-around):
kustomization.yaml in
secrets/staging
andsecrets/production
:The text was updated successfully, but these errors were encountered: