python icon indicating copy to clipboard operation
python copied to clipboard

'set' object has no attribute 'openapi_types'

Open mattjwarren opened this issue 1 year ago • 3 comments

What happened (please include outputs or screenshots):

When running the following test code;

    body=k8s.client.V1PersistentVolumeClaim(metadata=k8s.client.V1ObjectMeta(
                                                name="%s-%s" % ("username","test_name")
                                            ),
                                            spec=k8s.client.V1PersistentVolumeClaimSpec(
                                                volume_mode="Filesystem",
                                                access_modes=["ReadWriteOnce"],
                                                storage_class_name="build-pvc",
                                                resources=k8s.client.V1ResourceRequirements(
                                                    requests={"storage","1Gi"}
                                                )
                                            )
    )
    try:
        api_response=k8s_client.create_namespaced_persistent_volume_claim("testnamespace",body,pretty=True)
    except Exception as e:
        return HttpResponse("ERROR Calling Kubernetes API:  %s" % e)
    I get the response 
    
    'set' object has no attribute 'openapi_types'

What you expected to happen:

PVC is created as named in the givennamespace

How to reproduce it (as minimally and precisely as possible):

Code provided above.

Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version): 1.25.16
  • OS (e.g., MacOS 10.13.6): linux / ubuntu 20.02
  • Python version (python --version) 3.1.0.12
  • Python client version (pip list | grep kubernetes) 25.3.0

problem also occurs with 29. version.

mattjwarren avatar Feb 14 '24 11:02 mattjwarren

@mattjwarren Could you follow one of the examples to perform a creation? https://github.com/kubernetes-client/python/tree/master/examples I wonder if the issue is happening to other types as well, or just PVC?

roycaihw avatar Feb 26 '24 17:02 roycaihw

Hi, just noted your response; I will follow up and post results here

mattjwarren avatar Mar 19 '24 15:03 mattjwarren

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 Jun 17 '24 15:06 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 Jul 17 '24 15:07 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages 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:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Aug 16 '24 16:08 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages 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:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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 16 '24 16:08 k8s-ci-robot