Kustomize: Getting fails to load: plugin: not implemented when using custom generator plugin

Created on 26 Mar 2020  ยท  8Comments  ยท  Source: kubernetes-sigs/kustomize

I'm not sure what happens to "rotten" issues, so I've reopened the #1641 issue with the same title. I guess this can be considered a duplicate.

I am experiencing the same issue with Kustomize v3.5.4 as described in #1641:

kustomize version
{Version:kustomize/v3.5.4 GitCommit:3af514fa9f85430f0c1557c4a0291e62112ab026 BuildDate:2020-01-11T03:12:59Z GoOs:linux GoArch:amd64}

Go version:

go version
go version go1.13.9 linux/amd64

This is the output of tree:

.
โ”œโ”€โ”€ build
โ”‚   โ””โ”€โ”€ omninonsense.github.io
โ”‚       โ””โ”€โ”€ v1beta
โ”‚           โ””โ”€โ”€ sopsgenerator
โ”‚               โ””โ”€โ”€ SOPSGenerator.so
โ”œโ”€โ”€ build_helpers.go
โ”œโ”€โ”€ docs
โ”‚   โ””โ”€โ”€ kustomize-plugins.md
โ”œโ”€โ”€ examples
โ”‚   โ”œโ”€โ”€ database
โ”‚   โ”‚   โ”œโ”€โ”€ deployment.yaml
โ”‚   โ”‚   โ”œโ”€โ”€ kustomization.yaml
โ”‚   โ”‚   โ”œโ”€โ”€ postgres.env
โ”‚   โ”‚   โ”œโ”€โ”€ service.yaml
โ”‚   โ”‚   โ””โ”€โ”€ sops.yaml
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ go.mod
โ”œโ”€โ”€ go.sum
โ”œโ”€โ”€ kustomize-sopsgenerator.code-workspace
โ”œโ”€โ”€ Makefile
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ SOPSGenerator.go
โ”œโ”€โ”€ SOPSGenerator_test.go
โ””โ”€โ”€ __test__
    โ”œโ”€โ”€ encrypted
    โ”‚   โ”œโ”€โ”€ secret.env
    โ”‚   โ”œโ”€โ”€ secret.json
    โ”‚   โ””โ”€โ”€ secret.yaml
    โ”œโ”€โ”€ pgp.asc
    โ””โ”€โ”€ plain
        โ”œโ”€โ”€ secret.env
        โ”œโ”€โ”€ secret.json
        โ””โ”€โ”€ secret.yaml

After building the plugin, I run:

cd examples
export KUSTOMIZE_PLUGIN_HOME=$(readlink -f ../build)
kustomize build --enable_alpha_plugins database/

Which gives me:

Error: loading generator plugins: plugin /home/(โ€ฆ)/build/omninonsense.github.io/v1beta/sopsgenerator/SOPSGenerator fails to load: plugin: not implemented

The plugin exists, though:

ls /home/(โ€ฆ)/build/omninonsense.github.io/v1beta/sopsgenerator/
SOPSGenerator.so
areapi areplugin kinbug triagneeds-information

All 8 comments

Alas, I figured it out.

tl;dr: The problem was that I was downloading the kubernetes binary from the GitHub release. Installing Kustomize via go get sigs.k8s.io/kustomize/kustomize/[email protected] solves the issue.

This isn't even a _kustomize_ error that's being reported, it's an error that Go itself is reporting (the overloaded use of the term "plugin" was confusing me)

I _think_ the compiled kustomize on the release page comes without plugin support, because it was compiled with CGO_ENABLED=0. The golang.org/src/plugin/plugin_stubs.go ultimately gave me the hint to look in the right direction. I'm far from being a seasoned Go developer, so take these deductions with a pinchfistful of salt.

I will leave this open for now in case the maintainers want to look into this? If not, the @k8s-ci-robot / @fejta-bot will close it automatically.

CC-ing you since you were part of the discussion in the issue before (sorry if it's noise): @arthurgustin, @oboukili, @snarlysodboxer

In case this is just a quirk of Kustomize (whether desired or not) that's not trivial to fix, maybe it's worth documenting it somewhere? I quickly glanced over the documentation, but haven't found it being mentioned anywhere.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Will check does this still exist.

This is still happening in the latest release (v3.8.6). However, I suspect that this is intended. Since in the GO plugin guide

Need v3.0.0 for what follows, and you must compile it (not download the binary from the release page):

Awesome that it's documented now! ๐Ÿ˜

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicks picture nicks  ยท  3Comments

yujunz picture yujunz  ยท  5Comments

pst picture pst  ยท  4Comments

nabadger picture nabadger  ยท  4Comments

natasha41575 picture natasha41575  ยท  3Comments