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

select an RBAC version for kubefed it knows how to speak #50537

Merged
merged 1 commit into from
Aug 12, 2017

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Aug 11, 2017

kubefed tries to speak whatever version of RBAC the server has, regardless of whether it knows about that version or not. the version discovery it does has to select a version both it and the server speak.

related to #50534

fixes kubefed's ability to create RBAC roles in version-skewed clusters

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 11, 2017
@k8s-github-robot k8s-github-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 11, 2017
@liggitt liggitt added this to the v1.7 milestone Aug 11, 2017
@liggitt liggitt added kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. queue/fix labels Aug 11, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 11, 2017
@nikhiljindal
Copy link
Contributor

Thanks! To clarify the clientset that kubefed is using needs to know about these versions (for ex: be able to convert internal Role struct to v1.Role struct). kubefed does not have any version specific logic, right?

@@ -285,27 +288,47 @@ func getRBACVersion(discoveryclient discovery.CachedDiscoveryInterface) (*schema
return nil, fmt.Errorf("Couldn't get clientset to create RBAC roles in the host cluster: %v", err)
}

// These are the RBAC versions we can speak
knownVersions := map[schema.GroupVersion]bool{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a generic problem we need to solve for all API resources that kubefed creates.
Filed #50540

Copy link
Member Author

@liggitt liggitt Aug 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you do discovery the same way for other resources, and work with internal versions and expect to be able to convert to the server's preferred version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we try to discover group versions for other resources. However, we do work with internal versions the same way, but that doesn't qualify to this list I guess.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So at other places, we assume that the server supports a specific version (like extensions/v1beta1.Deployments?). Why not do the same here?

Whenever we will add a new version, we will likely miss adding it here anyways.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because kubefed tried to support clusters with only alpha or only beta RBAC. I'm not opposed to fixing the version to v1beta1 for now, and moving to v1 later when v1beta1 is deprecated, though I'd keep this PR and the associated pick small, then change approaches going forward in 1.8

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing it as a follow up sgtm

@nikhiljindal
Copy link
Contributor

nikhiljindal commented Aug 11, 2017

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 11, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, nikhiljindal

Associated issue: 50534

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. labels Aug 11, 2017
@liggitt
Copy link
Member Author

liggitt commented Aug 11, 2017

To clarify the clientset that kubefed is using needs to know about these versions (for ex: be able to convert internal Role struct to v1.Role struct). kubefed does not have any version specific logic, right?

Exactly, it's all about the conversion. Your choices are either to work with external versions (like kubectl does when it just passes through a manifest given to it with kubectl create -f ...) and require the server to speak that version, or to work with internal versions and select an external version the server knows about that you know how to convert to.

@liggitt liggitt added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. release-note-label-needed labels Aug 12, 2017
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Aug 12, 2017

@liggitt: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-unit 7f1a617 link /test pull-kubernetes-unit

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@liggitt
Copy link
Member Author

liggitt commented Aug 12, 2017

Unrelated unit test failure. /retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 50537, 49699, 50160, 49025, 50205)

@k8s-github-robot k8s-github-robot merged commit c207dd5 into kubernetes:master Aug 12, 2017
@wojtek-t wojtek-t added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Aug 12, 2017
k8s-github-robot pushed a commit that referenced this pull request Aug 12, 2017
…7-upstream-release-1.7

Automatic merge from submit-queue

Automated cherry pick of #50537

fixes #50534

Cherry pick of #50537 on release-1.7.

#50537: select an RBAC version for kubefed it knows how to speak

```release-note
fixes kubefed's ability to create RBAC roles in version-skewed clusters
```
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants