Skip to content

docs(plugin): document KUSTOMIZE_PLUGIN_HOME and plugin-home resolution#6127

Open
alliasgher wants to merge 2 commits into
kubernetes-sigs:masterfrom
alliasgher:docs/5706-plugin-home
Open

docs(plugin): document KUSTOMIZE_PLUGIN_HOME and plugin-home resolution#6127
alliasgher wants to merge 2 commits into
kubernetes-sigs:masterfrom
alliasgher:docs/5706-plugin-home

Conversation

@alliasgher

Copy link
Copy Markdown

Summary

Adds a "Plugin home" section to `plugin/README.md` describing the directory kustomize uses to look up Exec and Go plugins.

The section documents the four-step resolution order kustomize applies to find the plugin home:

  1. `$KUSTOMIZE_PLUGIN_HOME`
  2. `$XDG_CONFIG_HOME/kustomize/plugin`
  3. `$HOME/.config/kustomize/plugin` (used when `$XDG_CONFIG_HOME` is unset)
  4. `$HOME/kustomize/plugin`

It also notes the Windows `$USERPROFILE` fallback for `$HOME` and the relative layout kustomize uses to load an individual plugin (`///`).

Content comes directly from `api/konfig/plugins.go` and `api/internal/plugins/loader/loader.go`.

Fixes #5706.

/kind documentation

@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. labels Apr 17, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alliasgher
Once this PR has been reviewed and has the lgtm label, please assign varshaprasad96 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
k8s-ci-robot requested review from koba1t and sarab97 April 17, 2026 00:08
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 17, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @alliasgher!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 17, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @alliasgher. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 17, 2026
Add a "Plugin home" section to plugin/README.md describing the order
in which kustomize resolves the plugin home directory:

  1. $KUSTOMIZE_PLUGIN_HOME
  2. $XDG_CONFIG_HOME/kustomize/plugin
  3. $HOME/.config/kustomize/plugin
  4. $HOME/kustomize/plugin

Also note the Windows $USERPROFILE fallback and the relative path
layout used when loading an individual plugin. Content is taken
directly from api/konfig/plugins.go and api/internal/plugins/loader.

Signed-off-by: Ali <alliasgher123@gmail.com>
@alliasgher
alliasgher force-pushed the docs/5706-plugin-home branch from a20caf6 to dc29d4b Compare April 17, 2026 00:20
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 17, 2026
@k8s-triage-robot

Copy link
Copy Markdown

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@kubernetes-prow kubernetes-prow Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 16, 2026
@koba1t koba1t closed this Jul 16, 2026
@koba1t koba1t reopened this Jul 16, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alliasgher
Once this PR has been reviewed and has the lgtm label, please assign varshaprasad96 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koba1t

koba1t commented Jul 16, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 16, 2026
Comment thread plugin/README.md
unset.
4. `$HOME/kustomize/plugin`.

If none of the above exist, plugin resolution fails. On Windows,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows, the code does not fall back from HOME to USERPROFILE; homeEnv() directly selects USERPROFILE instead of HOME. Please change this to something like: “On Windows, $USERPROFILE is used in place of $HOME.”

Comment thread plugin/README.md
1. `$KUSTOMIZE_PLUGIN_HOME` — set this to override the default search
paths below (useful when plugins live outside `$HOME`).
2. `$XDG_CONFIG_HOME/kustomize/plugin`.
3. `$HOME/.config/kustomize/plugin` — used when `$XDG_CONFIG_HOME` is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note for $HOME/.config/kustomize/plugin does not match the implementation. This candidate is always tried after $XDG_CONFIG_HOME/kustomize/plugin; it is not limited to the case where XDG_CONFIG_HOME is unset. If XDG_CONFIG_HOME is set but that directory does not exist, Kustomize still falls back to $HOME/.config/kustomize/plugin.
Could we describe this as the default XDG-style location, or explicitly say that it is also tried when the configured XDG path does not exist?

Comment thread plugin/README.md
matching the `apiVersion` and `kind` fields of the generator or
transformer entry in `kustomization.yaml`.

#### Testing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new heading changes the document hierarchy so that #### Testing becomes a subsection of ### Plugin home. Since that section describes plugin testing in general, could we either move Plugin home after Testing or promote Testing to an ### heading?

Comment thread plugin/README.md Outdated
Within the plugin home, an individual plugin is loaded from
`<apiVersion group>/<apiVersion version>/<lowercase kind>/<Kind>`,
matching the `apiVersion` and `kind` fields of the generator or
transformer entry in `kustomization.yaml`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please distinguish the Exec and Go plugin paths. Kustomize first tries //// as an executable, then tries the same path with .so for a Go plugin.
Also, generators and transformers entries in kustomization.yaml are file paths. The apiVersion and kind are read from the referenced plugin configuration file, not directly from the list entry itself. An explicit example would make this much clearer.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: the docs now note that generators/transformers entries are file paths whose apiVersion and kind come from the referenced config file, and that kustomize resolves the derived path first as an executable (Exec plugin) then as .so (Go plugin), with an explicit SedTransformer example.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Details

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-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document KUSTOMIZE_PLUGIN_HOME

4 participants