-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
⚠️ Add CAPI owned kubeadm types #4255
⚠️ Add CAPI owned kubeadm types #4255
Conversation
a6b0926
to
6fd499e
Compare
/retest |
/test pull-cluster-api-test-main |
6fd499e
to
15a6ffb
Compare
/hold cancel |
@vincepri this one is ready for review now |
15a6ffb
to
02e6697
Compare
/test pull-cluster-api-test-main |
util/conversion/conversion.go
Outdated
// NOTE: Kubeadm types does not have ObjectMeta, so this step is executed only when required. | ||
metaAfter, ok := spokeAfter.(metav1.Object) | ||
if ok { | ||
delete(metaAfter.GetAnnotations(), DataAnnotation) | ||
} |
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.
If there is not ObjectMeta in the kubeadm types, why use this function to test? Could we pass the encapsulating object instead?
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.
With the new conversions, kubeadm v1beta1 and v1beta2 two types are defined as conversion spoke, and the don't have encapsulating objects anymore.
So, given that v1beta1 and v1beta2 (which are mirrored from kubeadm) do not have ObjectMeta, it was require to introduce this type check before calling delete
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.
Wouldn't it be better to just use the super-types instead each inner type? Without this logic, we have no way to preserve conversion between types
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.
@vincepri I have added a commit where I'm trying to make skipping this operation something that should be required explicitly (vs trying to assume intent)
type BootstrapTokenString struct { | ||
ID string `json:"-"` | ||
Secret string `json:"-"` | ||
} |
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 to keep the token as a struct?
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.
According to the CAEP as a first step we are going to create v1alpha4 types equal to v1beta1 (thus including token struct).
As soon as conversion are in place then we could start simplifying Cluster API owned types
ad73e03
to
3c3f298
Compare
3c3f298
to
35c2ffe
Compare
35c2ffe
to
e8cb88e
Compare
@fabriziopandini: The following test 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. |
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
What this PR does / why we need it:
This PR:
Which issue(s) this PR fixes:
Fixes #
/milestone v0.4.0
/hold
For the CAEP to merge
@vincepri