-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ Continue to fix scaffolding hub and spoke interfaces #3201
✨ Continue to fix scaffolding hub and spoke interfaces #3201
Conversation
Hi @momom-i. 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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
91e74d7
to
ee1478c
Compare
pkg/plugins/golang/v3/webhook.go
Outdated
fs.BoolVar(&p.options.DoHubScaffold, "hub", false, | ||
"if set, scaffold ConvertTo function for Hub conversion") | ||
fs.BoolVar(&p.options.DoSpokeScaffold, "spoke", false, | ||
"if set, scaffold ConvertFrom function for Spoke conversion") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a hub and spoke interfaces for the other types that are not the Conversion ones?
If not, what about we add a validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we have both spoke and hub as true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean if you set spoke or hub flags true, conversion flag should be true, right?
I don’t understand exactly what conversion flag do besides it prints messages that says you have to implement Hub and Convertible interface here. If my understanding right, there is another option to eliminate conversion flag, I think.
As you mentioned, we can set both values true and might have to change that.
package v1 | ||
|
||
// Hub marks that a given type is the hub type for conversion. -- only the no-op method 'Hub()' is required. | ||
// See https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion#Hub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add a link for https://book.kubebuilder.io/multiversion-tutorial/conversion.html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with that. Adding it makes users helpful more.
@@ -0,0 +1,76 @@ | |||
package api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All go files must to have the license:
See that the check if failing because of that
./test/check-license.sh
Checking for license header...
license header checking failed:
Could you please copy and paste from other ones to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems great. I just added some nits and questions
You did a terrific work 🥇
I think would be very nice to get a review from @varshaprasad96 on this one.
return err | ||
} | ||
} | ||
|
||
if doConversion { | ||
fmt.Println(`Webhook server has been set up for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we not here add a condition to improve the text message?
It is valid only the options are not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed at 40988d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @momom-i,
I will need some time to read the docs and check the initial PR to see if that is right or not.
I think we need to ensure that what is scaffold is according to the docs.
I will let you know more about soon as possible.
Hi @momom-i, It seems that we have an old design doc to achieve this goal see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/crd_version_conversion.md (a few things might be outdated because it was written prior we have the plugins ecosystem). However, the initial idea was to scaffold the conversion appropriately. It is OK. We began from a version that still needs to do that. But we need to ensure that the base will allow us to grow to attend to these needs. So, it seems, for example, that we need to track in the PROJECT file and input what the GVK wants to convert instead of bool. Could you please check the design doc and the documentation https://book.kubebuilder.io/multiversion-tutorial/conversion.html and ensure that this implementation addresses the basic required requirements? |
@camilamacedo86
How can I get this requirement statement? Is there any documentation anywhere? |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@momom-i I read your PR and the OP's PR and seem like there are some discrepancies.
i) this important function is missing , instead of getting the resource from input, it actually gets it from the config file
ii) As this comment mentioned, we would want to make --version
as the --spoke
flag and completely remove --spoke flag
} | ||
|
||
c.Path = c.Resource.Replacer().Replace(c.Path) | ||
fmt.Println(c.Path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the fmt.Println
?
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: momom-i The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
@momom-i are you still interested in continue the effort? If not, I would love to dig deep into it 😄 |
@lauchokyip I'm sorry for my delay response. I'd like to continue to work on this. 🙏 |
Sure, would you be able to provide a timeline? |
Also please reach out on kubebuilder Slack channel if you need any help or more visibility |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
@momom-i: The following tests failed, say
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/test-infra repository. I understand the commands that are listed here. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
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:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
This PR is based on #2084.
I opened the PR but I wanted to be simpler so recreated it.
To scaffold hub and spoke interface, command-line is supposed to be like the following.
I will open another PR for document change.
Related issue: #2589