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

✨ (phase 2 plugins): enable external plugins to specify metadata and examples #2780

Conversation

everettraven
Copy link
Contributor

Description of the change

Update the external plugin implementation to allow external plugins to specify metadata and examples for their plugin:

  • Add the UpdateMetadata function to the init, create api, create webhook, and edit subcommands
  • Add helper functions for common functions related to this process
  • Uses a default metadata string if the external plugin does not provide any
  • Add unit tests to verify the change and helper functions work as expected

Add a new helper function called makePluginRequest for making requests to external plugins. This makes the code for making a request to external plugins easier to reuse and prevents code duplication.

  • Update existing helper functions to use this new helper function for making requests to external plugins

Motivation for the change

This change allows external plugins to specify the metadata and examples that are provided to a Kubebuilder CLI user when they request the help text for a plugin. This gives Kubebuilder CLI users the same native plugin feeling for external plugins.

For more information see issue #2690

Additional Context

resolves #2690

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 29, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @everettraven. 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.

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@everettraven everettraven force-pushed the p2p/external-metadata-examples branch from d60aea0 to fc97428 Compare June 29, 2022 13:27
@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 Jun 29, 2022
@everettraven
Copy link
Contributor Author

The APIDiff failure is expected as there was a change made to the external plugin API.

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 🥇

@camilamacedo86
Copy link
Member

/ok-to-test
/lgtm

@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 29, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, 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 29, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2022
@everettraven
Copy link
Contributor Author

@camilamacedo86 The APIDiff failure is expected since the external plugin API was changed for this. Would you be able to override this check so it can merge? Thanks!

@camilamacedo86 camilamacedo86 merged commit c761f83 into kubernetes-sigs:master Jun 29, 2022
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.

Phase 2 Plugins should allow for external plugin authors to define metadata and examples
3 participants