Skip to content

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

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.

Activity

  1. 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[/+] on Dec 17, 2018
  2. 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[/+] on Dec 17, 2018
  3. micw523 commented on Dec 18, 2018

    @micw523
    Contributor

    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?

  4. hjohn06 commented on Dec 18, 2018

    @hjohn06
    Author

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

  5. kmai commented on Jan 11, 2019

    @kmai

    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 :)

  6. micw523 commented on Jan 11, 2019

    @micw523
    Contributor

    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.

  7. jasonmimick commented on Feb 22, 2019

    @jasonmimick

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

  8. micw523 commented on Feb 23, 2019

    @micw523
    Contributor

    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

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