Skip to content

External plugins discovery fails when XDG_CONFIG_HOME is set #3224

@em-r

Description

@em-r

What broke? What's expected?

On Ubuntu, when specifying an external plugin to any subcommand (e.g. init) through the --plugins flag, the subcommand fails if XDG_CONFIG_HOME is set to its default value $HOME/.config, with the following error:

2023/02/11 15:35:25 no plugin could be resolved with key "myexternalplugin/v1"

The subcommands eventually run successfully after unsetting XDG_CONFIG_HOME.

Reproducing this issue

  1. Set XDG_CONFIG_HOME variable in the shell: export XDG_CONFIG_HOME=$HOME/.config
  2. Create a folder for an external plugin: mkdir -p $XDG_CONFIG_HOME/kubebuilder/plugins/myexternalplugin/v1
  3. Copy the plugin binary to the directory created in 2).
  4. Initialize a new project: kubebuilder init --plugins=myexternalplugin/v1
  5. Notice how the execution will exit with an error, and myexternalplugin won't appear in the available plugins table.

KubeBuilder (CLI) Version

3.9.0

PROJECT version

No response

Plugin versions

No response

Other versions

Go version: 1.19.4 linux/amd64
OS version: Ubuntu 22.04.1 LTS

Extra Labels

No response

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions