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

Skip to content

create_from_yaml is converting rbac.authorization.k8s.io/v1 incorrectly #708

Closed
@hjohn06

Description

@hjohn06

The create_from_yaml function in utils is gets an error when trying to create resources that use the rbac api. For example, when trying to create the role below with create_from_yaml.

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: default
  name: pod-reader

It results in the following error.

>           k8s_api = getattr(client, fcn_to_call)(k8s_client)
E           AttributeError: module 'kubernetes.client' has no attribute 'Rbac.authorizationV1Api'

rbac.authorization.k8s.io/v1 is being converted into Rbac.authorizationV1Api instead of RbacAuthorizationV1Api. Additional logic is needed to convert this correctly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions