Thanks to visit codestin.com
Credit goes to github.com

Skip to content

async creation of custom resources (CR) using the CRD is failing #1626

Closed
@venukarnati92

Description

@venukarnati92

Async creation of custom resources (CR) using the CRD is failing for dynamic Client create call.

Synchronous Implementation with this example is working fine https://github.com/kubernetes-client/python/blob/master/examples/dynamic-client/namespaced_custom_resource.py

Now to make creation process as async update line number 192 on the above example to the following

ingressroute_api.create(body=ingressroute_manifest_first, namespace=namespace_first, async_req=True)

Error Message

(ansible) 21-11-16 2:45:14 venu.karnati@ABOUTPIANOORIGIN:~/Desktop/gitProject/python/examples/dynamic-client$ python namespaced_custom_resource.py Traceback (most recent call last): File "namespaced_custom_resource.py", line 250, in <module> main() File "namespaced_custom_resource.py", line 192, in main ingressroute_api.create(body=ingressroute_manifest_first, namespace=namespace_first, async_req=True) File "/Users/venu.karnati/.pyenv/versions/ansible/lib/python3.6/site-packages/kubernetes/dynamic/client.py", line 119, in create return self.request('post', path, body=body, **kwargs) File "/Users/venu.karnati/.pyenv/versions/ansible/lib/python3.6/site-packages/kubernetes/dynamic/client.py", line 62, in inner return serializer(self, json.loads(resp.data.decode('utf8'))) AttributeError: 'ApplyResult' object has no attribute 'data'

Environment:

  • Kubernetes version 1.21.2
  • MacOS 11.6):
  • Python 3.6.8
  • kubernetes 18.20.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions