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

📖 Plugin Phase 2 Enhancement Proposal #2243

Merged

Conversation

rashmigottipati
Copy link
Contributor

Description of the change
This PR adds an enhancement proposal for Kubebuilder Phase 2 Plugins

Signed-off-by: Rashmi Gottipati [email protected]

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 30, 2021
@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 Jun 30, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @rashmigottipati. 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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 30, 2021
@rashmigottipati
Copy link
Contributor Author

/cc @estroz @Adirio @jmrodri

@k8s-ci-robot
Copy link
Contributor

@rashmigottipati: GitHub didn't allow me to request PR reviews from the following users: jmrodri.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @estroz @Adirio @jmrodri

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.

Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

A few items to clarify.

designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
@jmrodri
Copy link
Contributor

jmrodri commented Jul 2, 2021

I think we need to add more details on the following:

  • what the potential structure looks like being passed in. I would start with assuming JSON format.
  • think about the messages we can send to the plugins? i.e. get_flags or register, init, create_api, create_webhook, these will be part of the message being sent. Each of these will have their own set of parameters and return values. The plugin implementer should be able to handle some or all of these, at a minimum get_flags or register.

@jmrodri
Copy link
Contributor

jmrodri commented Jul 2, 2021

Interestingly enough, a lot of what we're talking about here reminds me of CORBA.

@jmrodri
Copy link
Contributor

jmrodri commented Jul 2, 2021

@estroz made a good point when he mentioned security regarding the environment. @rashmigottipati What's our answer for security of the plugins? For example, do we prevent or care if someone has malicious code that we could run arbitrarily? Do we need a signature for plugins that can be verified? Or do we leave that up to the user that installed the plugin that they have verified it is from a known source and they have chosen to install it?

Copy link
Contributor

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Lots of cleanup needed.

Another issue has come to mind too: what happens when an external plugin wants to run a generator on some files it added to the universe? It cannot write those files itself since the universe wouldn't reflect the file's actual state, and it cannot run the generator if the files don't exist on-disk. I think some sort of post-plugin hook (executable) could be added to the PluginResponse struct so kubebuilder can execute it after writing the universe to disk. This hook executable would be in the same directory as the external plugin itself, but the plugin executable name would be different (specified in the PluginResponse). Thoughts?

designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

@rashmigottipati quick nit for the overview. Apply @estroz comments and I will re-review again. I agree with eric's additions but it's hard to reconcile until they have been applied.

designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
@rashmigottipati
Copy link
Contributor Author

@estroz What do you think about adding a GeneratorPath field in the PluginResponse struct that specifies the path to the executable that Kubebuilder will need to execute post Run? Not all plugins would need to run generators on files, so if a plugin does not set this field, specifying the omitempty option will exempt that field from encoding if it has an empty value.

@rashmigottipati
Copy link
Contributor Author

After having an offline discussion with @estroz, we decided to implement the post plugin hooks in follow-ups.

@rashmigottipati rashmigottipati force-pushed the proposal-phase2-plugins branch 3 times, most recently from 5ac60f5 to 675447a Compare August 9, 2021 20:34
Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

A couple things and suggestions.

designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
designs/extensible-cli-and-scaffolding-plugins-phase-2.md Outdated Show resolved Hide resolved
@rashmigottipati rashmigottipati force-pushed the proposal-phase2-plugins branch 3 times, most recently from 0a93566 to 6c567ea Compare August 18, 2021 02:11
Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

@jmrodri: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

Copy link
Contributor

@estroz estroz left a comment

Choose a reason for hiding this comment

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

One small fix, otherwise lgtm! Will label after you push the change.

@estroz
Copy link
Contributor

estroz commented Aug 31, 2021

/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 Aug 31, 2021
Signed-off-by: Rashmi Gottipati <[email protected]>
Copy link
Contributor

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 31, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: estroz, jmrodri, rashmigottipati

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 Aug 31, 2021
@k8s-ci-robot k8s-ci-robot merged commit 7cecf9d into kubernetes-sigs:master Aug 31, 2021
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.

6 participants