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

Skip to content

create_from_yaml custom resource #740

Open
@brantlk

Description

@brantlk

I've got a custom resource description and I need to create custom resource for it. I've been able to create it using client.CustomObjectsApi(api_client).create_namespaced_custom_object(...) and using kubectl apply -f. I tried using the utils.create_from_yaml but it fails with a traceback:

    utils.create_from_yaml(self._api_client, f.name)
  File "/usr/lib/python3.6/site-packages/kubernetes/utils/create_from_yaml.py", line 53, in create_from_yaml
    k8s_api = getattr(client, fcn_to_call)(k8s_client)
AttributeError: module 'kubernetes.client' has no attribute 'Brantlk.comV1Api'

yaml is like:

apiVersion: brantlk.com/v1
kind: MyCustomResource
metadata:
    name: brant-instance
    namespace: default
spec:
    repositories: []

Pretty obvious what the problem is from the code.

Metadata

Metadata

Assignees

Labels

lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions