Create Workload API v1alpha2#136976
Conversation
mm4tt
left a comment
There was a problem hiding this comment.
Thanks, first round of comments
|
The linter failures do look like it's due to your code. |
Go version got upgraded in k/k just recently - and with it, the linters, including one that enforces using Fixed. |
thockin
left a comment
There was a problem hiding this comment.
Almost there - unclear about why we are leaving immutable marked as alpha?
Was this guidance from DV team (@yongruilin) ?
| // | ||
| // +optional | ||
| // +k8s:optional | ||
| // +k8s:alpha(since:"1.36")=+k8s:immutable |
There was a problem hiding this comment.
I thought we decided that the +k8s:alpha prefix was not needed, but I still see it here. I know the transition to DV is a little complicated (sorry) - am I missing a reason why this needs to stay alpha?
I think it can be removed for ALL of these DV tags since there is no equivalent handwritten logic?
There was a problem hiding this comment.
Contrary to e.g. k8s:optional, k8s:immutable hasn't reached the GA stability level - codegen opposed dropping the alpha prefix when I tried to do so.
There was a problem hiding this comment.
This also mimics what we had proposed in tosi3k#1.
There was a problem hiding this comment.
+k8s:immutable is not yet promoted to stable.
There was a problem hiding this comment.
@yongruilin -- I think that resources which are new (alpha), which are not doing new handwritten code, do we still need to do this "it's not stable" dance?
On one hand, the whole apigroup is alpha, so I don't care that the tag is not stable. I don't want to read handwritten code.
On the other hand, we can't let the API go to GA while the tag is still alpha.
Is this the best we can do? It's not terrible since it's 1:1 with a handwritten function, but play it out in the future.
A new API is being built. It needs a new tag. We add a new tag, but it is not stable. Does this mean we have to write handwritten code for the new tag-equivalent? That doesn't seem to mitigate any risk, which is why we need pre-stable tags in the first place.
How could we avoid needing new handwritten?
There was a problem hiding this comment.
Under current implementation, we can add // +k8s:validation-gen-nolint to the new type to bypass the lint check for this new API type. So that we can benefit from the pre-stable tags. And in the following release, when API is ready for GA, we should be able to promote the pre-stable tags to stable while dropping the validation-gen-nolint.
| // +required | ||
| // +listType=map | ||
| // +listMapKey=name | ||
| // +k8s:required |
There was a problem hiding this comment.
Bringing back a lost comment:
Given the discussion around the meaning of required WRT openapi vs. k8s, perhaps this should ALSO specify minItems=1. Right now "required" implies that, but openapi would allow podGroupTemplates=[] (since that satisfies openapi "required"). We don't actually have a minItems tag yet, but it's trivial to add and when we do it would apply to this.
@lalitc375 what do you think? Worthwhile or redundant?
There was a problem hiding this comment.
Lalit is OOO until next Monday, unfortunately :(
There was a problem hiding this comment.
If this ends up as the last comment, it could be a followup.
| // +patchStrategy=merge | ||
| // +listType=map | ||
| // +listMapKey=type | ||
| Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` |
There was a problem hiding this comment.
Why no DV tags for this? +k8s:listType=map etc
There was a problem hiding this comment.
Is it because we still need to manually call the ValidateConditions(), which causes dup errors? If so, maybe a comment here?
There was a problem hiding this comment.
Is it because we still need to manually call the ValidateConditions(), which causes dup errors?
Exactly.
If so, maybe a comment here?
Hmm, on one hand I agree such comment would bring about more clarity, on the other hand:
- IIUC it's preferable to have matching comments in the internal and the external API definitions - and we don't use the DV tags in the internal type definitions, so having that comment in the internal type would be confusing.
- Other APIs that use
metav1.Conditionin their status do not document that either - so it's more of a systemic problem rather than the problem with this particular API.
Would an appropriate comment in pkg/apis/scheduling/validation/validation.go instead (above the line where we use metav1validation.ValidateConditions) make more sense?
There was a problem hiding this comment.
It's only a "problem" in that adding DV to metav1.Condition would generate DV for ~every type, which is only a "problem" because we haven't spent time to fix that :)
There was a problem hiding this comment.
@aaron-prindle @yongruilin @lalitc375
Gut-check time: What if we actually started enabling deeper DV? When will we feel comfortable doing this?
… API Co-authored-by: yongruilin <[email protected]>
|
/test pull-kubernetes-unit |
|
/approve for API |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dom4ha, macsko, thockin, tosi3k, wojtek-t The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@tosi3k: 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. DetailsInstructions 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. |
|
/lgtm Based on all the approvers I think this can merge. |
|
LGTM label has been added. DetailsGit tree hash: e2393388dac61a91f5644d2bc73ad6e84ada373d |
|
BTW, is there an associated docs PR? |
|
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
This PR creates v1alpha2 version of the Workload API (and, at the same time, deletes the old version of that API, v1alpha1) and introduces a brand new v1alpha2 PodGroup API. It also replaces WorkloadRef field in the Pod API with the SchedulingGroup field that refers to the new PodGroup API.
This is basically a lion share of the work related to decoupling the PodGroups from Workloads as a separate API which is described in KEP: kubernetes/enhancements#5832.
Which issue(s) this PR is related to:
KEP: kubernetes/enhancements#4671
KEP: kubernetes/enhancements#5832
Special notes for your reviewer:
/sig scheduling
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: