Skip to content
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

'set' object has no attribute 'openapi_types' #2193

Open
mattjwarren opened this issue Feb 14, 2024 · 2 comments
Open

'set' object has no attribute 'openapi_types' #2193

mattjwarren opened this issue Feb 14, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mattjwarren
Copy link

mattjwarren commented Feb 14, 2024

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 mattjwarren added the kind/bug Categorizes issue or PR as related to a bug. label Feb 14, 2024
@roycaihw
Copy link
Member

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

@mattjwarren
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants