Closed em-r closed 2 months ago
Welcome @em-r!
It looks like this is your first PR to kubernetes-sigs/kubebuilder-declarative-pattern 🎉. 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/kubebuilder-declarative-pattern 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. :smiley:
Hi @em-r. 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.
cc @justinsb @camilamacedo86 I've left a summary of the work done so far on the PR description. Thanks!
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: em-r Once this PR has been reviewed and has the lgtm label, please assign atoato88 for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
due to how Kubebuilder doesn't propagate project config on init
command, but rather injects it in PluginRequest.Universe
as part of PROJECT
file in subsequent commands (e.g. create api
), when externalizing declarative plugin, only one of the existing go plugins (e.g. go/v4
, go/v3
) can be supported for performing scaffolding.
So to support scaffolds with different versions of go plugin, https://github.com/kubernetes-sigs/kubebuilder/issues/3245 needs to be resolved by adding support for injecting project config into external plugins, similar to how it's done for plugins that are builtin to Kubebuilder.
cc @camilamacedo86
Hi @em-r,
The https://github.com/kubernetes-sigs/kubebuilder/issues/3245 is sorted out and available in the latest release 3.10. have we any other blocker to move forward within?
Hi @camilamacedo86, thank you for following up on this. I have just upgraded Kubebuilder locally to 3.10.0, however, I still couldn't find a way to access the project config or the layout via the input (e.g. PluginRequest) passed from Kubebuilder to the external plugin, could you please share with me how I can get access to one of those?
To recap: the problem is that the declarative plugin needs to know if the project is being scaffolded with go/v4
or go/v3
so that it can perform correct scaffolding around Dockerfile
in the init
subcommand. and unfortunately, when the init
subcommand is running, the PROJECT
file won't exist at that point so extracting the layout from it won't be an option, which leads me to think that we need to either "inject" the config (the way we do with internal plugins) through the PluginRequest
input.
Hi @em-r,
em-r commented last week Hi @camilamacedo86, thank you for following up on this. I have just upgraded Kubebuilder locally to 3.10.0, however, I still couldn't find a way to access the project config or the layout via the input (e.g. PluginRequest) passed from Kubebuilder to the external plugin, could you please share with me how I can get access to one of those?
To recap: the problem is that the declarative plugin needs to know if the project is being scaffolded with go/v4 or go/v3 so that it can perform correct scaffolding around Dockerfile in the init subcommand. and unfortunately, when the init subcommand is running, the PROJECT file won't exist at that point so extracting the layout from it won't be an option, which leads me to think that we need to either "inject" the config (the way we do with internal plugins) through the PluginRequest input.
The plugin go/v3 is deprecated. Therefore, I would strongly say that this plugin should only cares about go/v4 layout. Therefore, the initial version should NOT care about or address this implementation. This complexity is sorted out.
However, to improve the Kubebuilder API for future needs, I tracked the issue: https://github.com/kubernetes-sigs/kubebuilder/issues/3396
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the PR is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the PR is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the PR is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the PR is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closed this PR.
What this PR does / why we need it: This PR copies the code of the declarative pattern plugin from kubebuilder to kubebuilder-declarative-pattern, as part of the ongoing effort to decouple the development of the plugin from the development of Kubebuilder now that Kubebuilder supports external plugins.
Which issue(s) this PR fixes:
Fixes #293
Special notes for your reviewer: Work done so far:
go mod tidy
Remaining items:
main
function) since external plugins are shipped as binaries. (docs)Additional documentation: