Skip to content
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

Error: loading generator plugins: failed to load generator: unexecutable plugin but plugin is executable #18528

Closed
paololazzari opened this issue Jun 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@paololazzari
Copy link

paololazzari commented Jun 6, 2024

My kustomization is using a plugin to generate secrets. Here's the layout:

├── base
│ ├── myapplication
│ │ ├── base
│ │ │ ├── deployment.yaml
│ │ │ ├── kustomization.yaml
│ │ │ └── svc.yaml
│ │ └── envs
│ │     ├── dev
│ │     │ ├── kustomization.yaml
│ │     │ └── secretGenerator.yaml
├── plugin
  └── util
    ├── gcloudsecretgenerator
      └── gcloudSecretGenerator

the plugin is an executable bash script. The executable bit has been commited to the git repository.

$ git ls-files --stage plugin/util/gcloudsecretgenerator/gcloudSecretGenerator
100755 e2096634c3aa718285647f258e1ba93701ec20b6 0	plugin/util/gcloudsecretgenerator/gcloudSecretGenerator

Now I can run this just fine locally. From the root repo:

KUSTOMIZE_PLUGIN_HOME="$(pwd)/plugin" kustomize build base/myapplication/envs/dev/ --enable-alpha-plugins

I am using the sidecar pattern in the argocd-repo-server pod, and mounting in the sidecar the following:

apiVersion: v1
data:
  plugin.yaml: |
    apiVersion: argoproj.io/v1alpha1
    kind: ConfigManagementPlugin
    metadata:
      name: kustomize-plugin
    spec:
      version: v1.0
      generate:
        command: ["sh", "-c"]
        args: ["KUSTOMIZE_PLUGIN_HOME=../../../../plugin kustomize build --enable-alpha-plugins"]

In argocd I see the following:

ComparisonError: Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = Manifest generation error (cached): plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: sh -c "KUSTOMIZE_PLUGIN_HOME=../../../../plugin kustomize build --enable-alpha-plugins" failed exit status 1: Error: loading generator plugins: failed to load generator: unexecutable plugin at: ../../../../plugin/util/gcloudsecretgenerator/gcloudSecretGenerator

the sidecar container has the following:

securityContext:
  runAsNonRoot: true
  runAsUser: 999
@paololazzari paololazzari added the bug Something isn't working label Jun 6, 2024
@paololazzari
Copy link
Author

Explicitly setting it executable fixed it, but this shouldn't be necessary:

apiVersion: v1
data:
  plugin.yaml: |
    apiVersion: argoproj.io/v1alpha1
    kind: ConfigManagementPlugin
    metadata:
      name: kustomize-plugin
    spec:
      version: v1.0
      generate:
        command: ["sh", "-c"]
        args: ["chmod +x ../../../../plugin/util/gcloudsecretgenerator/gcloudSecretGenerator; KUSTOMIZE_PLUGIN_HOME=../../../../plugin kustomize build --enable-alpha-plugins"]

@paololazzari
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant