-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
KRM Exec Function can't locate executable when referencing a base #4347
Comments
btw a work around is to just put the plugin in your $PATH and reference it without a path |
This looks like a duplicate of #4350. What timing! |
/triage accepted The fact that the Kustomization in question reading a child Kustomization interferes with the path is highly suspicous. I think the root cause of both this and #4350 is that we're not properly deep copying the plugin loader here: kustomize/api/internal/target/kusttarget.go Lines 44 to 45 in a8f58b4
Since the loader contains a pointer to a @seh @pmcjury Since both issues are quite detailed (thank you!) I'm going to keep this one just because it was opened first. If either of you is interested in contributing a fix, please |
That's due to |
/assign |
@m-Bilal, have you had a chance to attempt a fix for this defect yet? |
@seh sorry, haven't had the time yet. I'll leave a comment here when I do start working on this, until then if anyone else wants to take this up, please feel free to do so. |
If I get it right, all that's needed to fix this is just to change the line no. 45 from In that case, it will make a full copy instead of referring to the pointer. If not, does anyone know what exactly is needed to fix this issue? |
It will make a shallow copy. If you look at the Next, how we copy a I am not sure whether there are more fields that we'd need to copy deeply, but we do need to copy the |
/assign |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
This issue was killing me - I know functions are alpha but it took me a while to find this bug report. Since I'm executing in a CD environment, changing the
|
/close Issue should be fixed by #4654 |
@annasong20: 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. |
Describe the bug
When using a KRM exec function with a relative path to the kustomization.yaml file, the executable can't be found when referencing a base from a variant.
It appears the function is "exec"-d relative to the base not the variant.
Things are further complicated when the base references another remote base.
Files that can reproduce the issue
Expected output
The dummy function should just echo out the resources read from stdin.
Actual output
Kustomize version
Platform
macOS ( M1 )
darwin21.0
arm64
Additional context
Some other scenarios:
./plugins/function.sh
to the base, the plugin works even if the krm-function.yaml is located in the variantTo further complicate things, if I add a remote base to the local base I get this error:
The text was updated successfully, but these errors were encountered: