-
Notifications
You must be signed in to change notification settings - Fork 41.2k
feat(apis/batch): PodFailurePolicyOnPodConditionsPattern.Status can be omitted #133479
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
base: master
Are you sure you want to change the base?
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Tue Aug 12 04:23:31 UTC 2025. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @mayooot. Thanks for your PR. I'm waiting for a kubernetes 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-sigs/prow repository. |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/label api-review |
the we can verify that those fields are marked as required in openapi: "io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern": {
"description": "PodFailurePolicyOnPodConditionsPattern describes a pattern for matching an actual pod condition type.",
"properties": {
"status": {
"description": "Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True.",
"type": "string"
},
"type": {
"description": "Specifies the required Pod condition type. To match a pod condition it is required that specified type equals the pod condition type.",
"type": "string"
}
},
"required": [
"type",
"status"
],
"type": "object"
}, however, if I submit a manifest to the server omitting that field, the API server does accept it and defaults the
That means the status field is not actually required. I think the correct change here would be to mark the field as |
pkg/apis/batch/types.go
Outdated
@@ -212,6 +212,7 @@ type PodFailurePolicyOnPodConditionsPattern struct { | |||
// Specifies the required Pod condition status. To match a pod condition | |||
// it is required that the specified status equals the pod condition status. | |||
// Defaults to True. | |||
// +default="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.
mark this field as // +optional
instead, and make the change to the v1/types.go and v1beta1/types.go files as well (will require regenerating docs, etc, with make update
)
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.
staging/src/k8s.io/api/batch/v1beta1/types.go
doesn't define the PodFailurePolicyOnPodConditionsPattern
struct, perhaps we should update both staging/src/k8s.io/api/batch/v1/types.go
and pkg/apis/batch/types.go
.
@liggitt Got it, I'll update it soon. |
…e omitted Signed-off-by: Harry Li <bertram_li@163.com>
0d10d5b
to
3f8de6c
Compare
/ok-to-test |
LGTM label has been added. Git tree hash: c17b3d7c8fcffe79c68a20a356a4d15769a59f67
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, mayooot 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 |
/retest-required |
if this is leading to errors, does that mean the client is doing blocking client-side validation by default? that's not really recommended... is there an issue in the python library tracking that? |
I think this can be resolved once this PR has been mered, because def __init__(self, status=None, type=None, local_vars_configuration=None): After: def __init__(self, type=None, local_vars_configuration=None): And the python @status.setter
def status(self, status):
"""Sets the status of this V1PodFailurePolicyOnPodConditionsPattern.
Specifies the required Pod condition status. To match a pod condition it is required that the specified status equals the pod condition status. Defaults to True. # noqa: E501
:param status: The status of this V1PodFailurePolicyOnPodConditionsPattern. # noqa: E501
:type: str
"""
- if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501
- raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501
self._status = status WDYT? |
What type of PR is this?
/kind feature
Optionally add one or more of the following kinds if applicable:
/kind api-change
What this PR does / why we need it:
kubernetes/pkg/apis/batch/types.go
Lines 205 to 217 in 0d10d5b
Status
is not explicitly set to "True", which may lead to errors in Python Kubernetes client generated by upstream.In kube-apiserver, the
Status
will be set to "True" automatically even if we don't set it manually - this can be done by a webhook or controller — but this does not resolve downstream errors.Which issue(s) this PR is related to:
kubernetes-client/python#2430
kubernetes-client/python#2432
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: