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

✨ Make external plugin path configurable #3437

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

Eileen-Yu
Copy link
Member

Description

  1. Introduce the usage of env variable KB_PLUGINS_PATH to define a customized path to store external plugins.
  2. Add corresponding unit tests

Sample

~/programming/temp/my-external-plugins  
❯ tree .
.
└── sampleexternalplugin
   └── v1
      └── sampleexternalplugin

~/programming/temp/my-external-plugins                                                                                                                                                
❯ KB_PLUGIN_PATH="/Users/eileen/programming/temp/my-external-plugins" \
  kubebuilder init --plugins=sampleexternalplugin/v1

Motivation

Make the external plugin path configurable so that users can easily manage their external plugins.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @Eileen-Yu. 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.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 1, 2023
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Overall really great work! My biggest request is to take another pass at the tests implementation and try to break them down into individual smaller tests

pkg/cli/options_test.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 5, 2023
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 Jun 6, 2023
@camilamacedo86
Copy link
Member

HI @Eileen-Yu,

Can we cover a little more with the tests:

coverage/coveralls — Coverage decreased (-0.1%) to 83.135%

It decrease here: https://coveralls.io/builds/60550613/source?filename=pkg%2Fcli%2Foptions.go

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Overall looks good and is a step in the right direction. What I would like to see is for the tests for the $XDGHOME and $HOME environment variables to be distinct tests (so no if ... else block to perform special test logic)

pkg/cli/options.go Outdated Show resolved Hide resolved
pkg/cli/options_test.go Outdated Show resolved Hide resolved
@Eileen-Yu Eileen-Yu force-pushed the external-plugin-path branch 2 times, most recently from b798681 to 12e5df7 Compare June 6, 2023 22:01
@Eileen-Yu Eileen-Yu force-pushed the external-plugin-path branch 3 times, most recently from 8f4d0f3 to d68ad58 Compare June 14, 2023 00:19
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Great work 🥇

Just a nit:
Otherwise, /lgtm

Is KB_PLUGINS_PATH the best name for the env var?
What about EXTERNAL_PLUGINS_PATH only?
I mean without kubebuilder since other projects can export Kubebuilder and use it as lib to create their own tools.

c/c @everettraven @rashmigottipati

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Overall looks great - I just have some more comments on the tests

pkg/cli/options_test.go Outdated Show resolved Hide resolved
pkg/cli/options_test.go Outdated Show resolved Hide resolved
pkg/cli/options_test.go Outdated Show resolved Hide resolved
pkg/cli/options_test.go Outdated Show resolved Hide resolved
Co-authored-by: Bryce Palmer <everettraven@gmail.com>
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Looks good to me! Great work @Eileen-Yu !

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 15, 2023
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Terrific work 🥇

/approved

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, Eileen-Yu, everettraven

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

The pull request process is described here

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 20, 2023
@k8s-ci-robot k8s-ci-robot merged commit cbea3f6 into kubernetes-sigs:master Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants