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

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

Closed
hjohn06 opened this issue Dec 17, 2018 · 6 comments · Fixed by #767
Closed

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

hjohn06 opened this issue Dec 17, 2018 · 6 comments · Fixed by #767
Assignees

Comments

@hjohn06
Copy link

hjohn06 commented Dec 17, 2018

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.

@hjohn06 hjohn06 changed the title create_from_yaml not converting rbac.authorization.k8s.io/v1 correctly create_from_yaml is not converting rbac.authorization.k8s.io/v1 correctly Dec 17, 2018
@hjohn06 hjohn06 changed the title create_from_yaml is not converting rbac.authorization.k8s.io/v1 correctly create_from_yaml is converting rbac.authorization.k8s.io/v1 incorrectly Dec 17, 2018
@micw523
Copy link
Contributor

micw523 commented Dec 18, 2018

Hi - I wrote the YAML feature. Indeed this is a pattern that I did not see when I wrote the feature.

/assign

Is it an urgent issue that you need to be fixed?

@hjohn06
Copy link
Author

hjohn06 commented Dec 18, 2018

I don't need it right away. Just reporting a bug.

@kmai
Copy link

kmai commented Jan 11, 2019

I wrote a quick fix that I'd like to contribute. Besides the CLA for companies, what else should I do? I want to test this throughly :)

@micw523
Copy link
Contributor

micw523 commented Jan 11, 2019

Hi @kmai -
Thanks for the contribution! However, this function is currently undergoing changes. Also, I assigned myself on this issue. Could you possibly look for another issue for now? I’ll be happy to give you a starting point if I could.

@jasonmimick
Copy link

@kmai - Hi, I'm working on a POC - would you mind sharing your quick fix for this to save me some time?
thanks-

@micw523
Copy link
Contributor

micw523 commented Feb 23, 2019

Hi @jasonmimick,

If you're adventurous, I welcome you to test out the code in PR #767.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants