python icon indicating copy to clipboard operation
python copied to clipboard

Documentation on V1PodFailurePolicyOnPodConditionsPattern - status defaulting to true is misleading

Open mjbarton712 opened this issue 4 months ago • 5 comments

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

mjbarton712 avatar Aug 04 '25 16:08 mjbarton712

/assign @mayooot

roycaihw avatar Aug 14 '25 20:08 roycaihw

@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.

k8s-ci-robot avatar Aug 14 '25 20:08 k8s-ci-robot

/assign

mayooot avatar Aug 15 '25 07:08 mayooot

@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?

mayooot avatar Aug 15 '25 08:08 mayooot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Nov 13 '25 09:11 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Dec 13 '25 09:12 k8s-triage-robot