kubebuilder
kubebuilder copied to clipboard
✨ pass config between KB and external plugin
Description:
Todo:
- [x] Add new specs
Configin both thePluginRequestandPluginResponse - [x] Create a local type definition in the sampleexternalplugin path for easier testing
- [x] Inject the config in
PluginRequestand pass it to the external plugin - [x] Update the config on the sample external plugin side, send the updated config back via response
- [x] Enable KB to update the config based on the modified the config passed back from
PluginResponse - [x] Add e2e tests
- Remove the
replaceonce the PR gets merged (next PR)
Sample PROJECT updated by go sample external plugin:
Motivation:
Aims to fix the issue https://github.com/kubernetes-sigs/kubebuilder/issues/3396
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
/test pull-kubebuilder-e2e-k8s-1-27-1
@Eileen-Yu: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:
/test pull-kubebuilder-e2e-k8s-1-26-6/test pull-kubebuilder-e2e-k8s-1-27-3/test pull-kubebuilder-e2e-k8s-1-28-0/test pull-kubebuilder-test
Use /test all to run all jobs.
In response to this:
/test pull-kubebuilder-e2e-k8s-1-26-1
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.
/test pull-kubebuilder-e2e-k8s-1-26-6
/test pull-kubebuilder-e2e-k8s-1-28-0
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Eileen-Yu, Kavinjsir Once this PR has been reviewed and has the lgtm label, please assign varshaprasad96 for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Tried to update it with the suggestions.. Is this what we're looking for?
Guess I meet with the similar blocker when I did this last time: the project version would somehow be 0 (but by default it should be 3, and it did show as 3 in the scaffolded PROJECT, but if print it in the middle it's actually 0... not quite sure what caused this), and PROECT content failed to update with new fields... but these issues wouldn't happen when req/res.Config is set to string.
Not sure if there's any unexpected issues in between 🤔
Hi @Eileen-Yu
Thank you for coming back on this one. it would be very nice if we could achieve it. Your help here is very appreciated.
Regards: https://github.com/kubernetes-sigs/kubebuilder/pull/3526#issuecomment-1940426602
When you try to run the commands from the external plugin, you create the Config struct instead of loading it from the Project file. More info: https://github.com/kubernetes-sigs/kubebuilder/pull/3526#discussion_r1487395021
Hi @camilamacedo86 , thx for the help!
a) squash the commits for we have just 1 here b) fix the lint issue c) rebase with master and push so that we can check it with the final state
I did all of the above lists.
And yes, I did see the unit tests still failed because of this version error:
msg: "unable to create config for version \"0\": version 0 is not supported",
err: <config.UnsupportedVersionError>{
Version: {Number: 0, Stage: 0},
I tried to fix this with this line: https://github.com/kubernetes-sigs/kubebuilder/pull/3526/files#diff-992e7a26b8776b12932c030601857ed56f364b1ecd7dc0fac9dcfd8c0cb903c6R66 but didn't get the luck 😔
Hi @Eileen-Yu
Regards: https://github.com/kubernetes-sigs/kubebuilder/pull/3526#issuecomment-1945344498 thank you a lot I do not have this weekend to check it out. But up the following one, I will run it locally and see if I can fix the nit
PR needs rebase.
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.
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle rotten - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
@Eileen-Yu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-kubebuilder-e2e-k8s-1-28-6 | 924daa742ac59c9728572396658aaae3199b770f | link | true | /test pull-kubebuilder-e2e-k8s-1-28-6 |
| pull-kubebuilder-e2e-k8s-1-27-10 | 924daa742ac59c9728572396658aaae3199b770f | link | true | /test pull-kubebuilder-e2e-k8s-1-27-10 |
| pull-kubebuilder-e2e-k8s-1-29-0 | 924daa742ac59c9728572396658aaae3199b770f | link | true | /test pull-kubebuilder-e2e-k8s-1-29-0 |
| pull-kubebuilder-test | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-test |
| pull-kubebuilder-e2e-k8s-1-27-3 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-27-3 |
| pull-kubebuilder-e2e-k8s-1-26-6 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-26-6 |
| pull-kubebuilder-e2e-k8s-1-28-0 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-28-0 |
| pull-kubebuilder-e2e-k8s-1-29-2 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-29-2 |
| pull-kubebuilder-e2e-k8s-1-27-11 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-27-11 |
| pull-kubebuilder-e2e-k8s-1-28-7 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-28-7 |
| pull-kubebuilder-e2e-k8s-1-30-0 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-30-0 |
| pull-kubebuilder-e2e-k8s-1-31-0 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-31-0 |
| pull-kubebuilder-e2e-k8s-1-31-4 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-31-4 |
| pull-kubebuilder-e2e-k8s-1-32-0 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-32-0 |
| pull-kubebuilder-e2e-k8s-1-30-8 | 65ae4a3563d9a83d0a4203b95b8e902636e19f49 | link | true | /test pull-kubebuilder-e2e-k8s-1-30-8 |
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
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. I understand the commands that are listed here.
Hi @Eileen-Yu
I think you are not working on this one anymore So, I am closing but feel free to re-open if you wish to rebase and work on it.