Documentation on V1PodFailurePolicyOnPodConditionsPattern - status defaulting to true is misleading
Link to the issue (please include a link to the specific documentation or example): https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1PodFailurePolicyOnPodConditionsPattern.md
Description of the issue (please include outputs or screenshots if possible):
The documentation states that the V1PodFailurePolicyOnPodConditionsPattern status param defaults to True, but there is validation that causes a V1PodFailurePolicyOnPodConditionsPattern with no defined status to fail since it defaults to None.
I had this for example in my code:
ignore_disruption_rule = kubernetes.client.V1PodFailurePolicyRule(
action="Ignore",
on_pod_conditions=[
kubernetes.client.V1PodFailurePolicyOnPodConditionsPattern(
type="DisruptionTarget",
)
],
)
but I got this error:
{"levelname": "ERROR", "message": "Invalid value type: Invalid value for `status`, must not be `None`",
I fixed it by adding the status="True" like so:
ignore_disruption_rule = kubernetes.client.V1PodFailurePolicyRule(
action="Ignore",
on_pod_conditions=[
kubernetes.client.V1PodFailurePolicyOnPodConditionsPattern(
type="DisruptionTarget",
status="True",
)
],
)
So I think we need to either make the default true or else remove that from the documentation and say it is a required parameter
/assign @mayooot
@roycaihw: GitHub didn't allow me to assign the following users: mayooot.
Note that only kubernetes-client members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide
In response to this:
/assign @mayooot
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.
/assign
@roycaihw @mjbarton712 The status field should be omitted and will be set to True automatically.
I fixed it in https://github.com/kubernetes/kubernetes/pull/133479, and I'll regenerate the docs and Python files when it is merged.
WDYT?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues 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 issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale - Close this issue 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 issues.
This bot triages un-triaged issues 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 issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle rotten - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten