Skip to content

Documentation on V1PodFailurePolicyOnPodConditionsPattern - status defaulting to true is misleading #2430

@mjbarton712

Description

@mjbarton712

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/documentationCategorizes issue or PR as related to documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions