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

Issue during building , used go1.13 , need to know which kustomize version tag I need used #7

Open
Ishafak opened this issue Jul 9, 2021 · 2 comments

Comments

@Ishafak
Copy link

Ishafak commented Jul 9, 2021

Used go1.13 and tried using kustomize/v3.8.0, v3.8.1 and 3.8.2 (compiled with go1.13) and compiled the plugin also with go1.13

on running the kustomize build it gives the following error:
"Attempting plugin load from 'kustomize/plugin/secretgenerator/SecretGenerator.so'
Error: loading generator plugins: plugin kustomize/plugin/secretgenerator/SecretGenerator.so fails to load: plugin.Open("kustomize/plugin/secretgenerator/SecretGenerator"): plugin was built with a different version of package sigs.k8s.io/kustomize/api/resid"

@bbl
Copy link
Owner

bbl commented Jul 11, 2021

Hello @Ishafak!
How do you use secretize? It is intended to be a kustomize exec plugin, not a shared library.

So, you need to download the binary and install it into your plugin home directory, e.g. ~/.config/kustomize/plugin/secretize/v1/secretgenerator/.
In this folder, you need to store the SecretGenerator binary:

plugin_dir="~/.config/kustomize/plugin/secretize/v1/secretgenerator/"
mkdir -p $plugin_dir
curl -L https://github.com/bbl/secretize/releases/download/v0.0.1/secretize-v0.0.1-linux-amd64.tar.gz  | tar -xz -C $plugin_dir

@Ishafak
Copy link
Author

Ishafak commented Jul 12, 2021

Hi @bbl
I followed the steps for the exec plugin and now when I do the kustomize build it gives, Verified path exists in vault with cli
(vault kv get path/to/secret)
----- kustomization.yaml
generators:

  • example1.yaml
    ---- example1.yaml apiVersion: secretize/v1
    kind: SecretGenerator
    metadata:
    name: env-secrets
    sources:
    • provider: hashicorp-vault
      kv:
      • path/to/secret

kustomize build --enable-alpha-plugins

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 1 [running]:
github.com/bbl/kustomize-secrets/internal/providers.(*HashicorpVaultProvider).GetKVSecrets(0xc0003a30f0, 0xc000041aa0, 0x22, 0x137e9c0, 0xc0000d3f01, 0xc0003a30f0)
/github/workspace/internal/providers/hashicorp_vault.go:22 +0x261
github.com/bbl/kustomize-secrets/pkg/generator.FetchProviderSecrets(0x17c83a0, 0xc0003a30f0, 0xc0003a3060, 0x1, 0x1, 0x0, 0x0, 0x0, 0x101, 0x2195de0, ...)
/github/workspace/pkg/generator/generator.go:109 +0x1b8
github.com/bbl/kustomize-secrets/pkg/generator.(*SecretGenerator).FetchSecrets(0xc000091f80, 0x155d8a0, 0x29f, 0xc000091f80, 0x0)
/github/workspace/pkg/generator/generator.go:88 +0x192
main.main()
/github/workspace/cmd/secretize/main.go:28 +0x1a7
Error: failure in plugin configured via /tmp/kust-plugin-config-832116024; exit status 2: exit status 2

(tried with literals instead of kv and it gives error at the same line (main.go:28)
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants