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

Fix bug with InClusterConfig requiring bearer token. #69272

Closed
wants to merge 1 commit into from

Conversation

timothysc
Copy link
Member

What this PR does / why we need it:
In cluster configs were failing b/c of changes made by #67359

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #69234

Special notes for your reviewer:
I've verified this PR fixes the issue, and is critical priority.

Release note:

Fix bug caused by #67359 that caused some client-go generated InCluster KubeConfigs to fail.  

/sig testing
/sig auth
/sig apimachinery

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews @dims
/assign @liggitt @mikedanese @smarterclayton

This caused the e2es to fail when run in cluster.

Signed-off-by: Timothy St. Clair <timothysc@gmail.com>
@timothysc timothysc added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 30, 2018
@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 30, 2018
@k8s-ci-robot k8s-ci-robot added sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/auth Categorizes an issue or PR as relevant to SIG Auth. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 30, 2018
@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Sep 30, 2018
@timothysc timothysc added the kind/bug Categorizes issue or PR as related to a bug. label Sep 30, 2018
@k8s-ci-robot k8s-ci-robot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Sep 30, 2018
@dims
Copy link
Member

dims commented Oct 1, 2018

@timothysc based on discussion in #69270 @liggitt and @darxkies would like us to try this #69273 instead of trying to go back to initializing the bearertoken during initialization.

@dims
Copy link
Member

dims commented Oct 1, 2018

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 1, 2018
@timothysc
Copy link
Member Author

@dims @liggitt @mikedanese - there is still a weird problem now in that function is no longer self-contained, and anyone who was previously using it is now going to have an issue.

@liggitt
Copy link
Member

liggitt commented Oct 1, 2018

@dims @liggitt @mikedanese - there is still a weird problem now in that function is no longer self-contained, and anyone who was previously using it is now going to have an issue.

the returned config works correctly with transport/client construction... there have always been unserializable fields in the client config struct, so it cannot be assumed to be able to be serialized. extracting a statically read token and persisting it elsewhere is not going to work well as we gradually move to a world in which expiration/rotation occurs.

an alternative approach could be to set the tokenfile attribute on the returned InClusterConfig, and adjust transport construction to set up the refreshing token source at point of construction.

@timothysc
Copy link
Member Author

an alternative approach could be to set the tokenfile attribute on the returned InClusterConfig, and adjust transport construction to set up the refreshing token source at point of construction.

That's a pretty non-intuitive UX from a client library. It's what @dims did to patch the tests, but for general consumers of the library, that are not core k8s developers, it's going to be non-intuitive.

@timothysc timothysc closed this Oct 1, 2018
@smarterclayton
Copy link
Contributor

I really don't like this.

@smarterclayton smarterclayton reopened this Dec 4, 2018
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2018
@k8s-ci-robot
Copy link
Contributor

@timothysc: PR needs rebase.

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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: timothysc
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: liggitt

If they are not already assigned, you can assign the PR to them by writing /assign @liggitt in a comment when ready.

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@smarterclayton
Copy link
Contributor

We broke our ecosystem on a fairly critical token ithout a way to preserve compatibility. That's not what we do.

@smarterclayton
Copy link
Contributor

extracting a statically read token and persisting it elsewhere is not going to work well as we gradually move to a world in which expiration/rotation occurs.

That is an argument that people have to do work in that future, which they already had to do. This seems like we pulled this bandaid prematurely.

@k8s-ci-robot
Copy link
Contributor

@timothysc: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-bazel-build 1e4c010 link /test pull-kubernetes-bazel-build
pull-kubernetes-integration 1e4c010 link /test pull-kubernetes-integration
pull-kubernetes-bazel-test 1e4c010 link /test pull-kubernetes-bazel-test
pull-kubernetes-e2e-gce-100-performance 1e4c010 link /test pull-kubernetes-e2e-gce-100-performance
pull-kubernetes-kubemark-e2e-gce-big 1e4c010 link /test pull-kubernetes-kubemark-e2e-gce-big
pull-kubernetes-typecheck 1e4c010 link /test pull-kubernetes-typecheck
pull-kubernetes-e2e-kops-aws 1e4c010 link /test pull-kubernetes-e2e-kops-aws
pull-kubernetes-e2e-gce 1e4c010 link /test pull-kubernetes-e2e-gce
pull-kubernetes-node-e2e 1e4c010 link /test pull-kubernetes-node-e2e
pull-kubernetes-e2e-gce-device-plugin-gpu 1e4c010 link /test pull-kubernetes-e2e-gce-device-plugin-gpu
pull-kubernetes-verify 1e4c010 link /test pull-kubernetes-verify

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.

@smarterclayton
Copy link
Contributor

I don't know that I would fix it this way - I might say we should fix the token transport to handle this, remove the need for wrap transport, and fix the token.

@liggitt
Copy link
Member

liggitt commented Dec 4, 2018

I don't know that I would fix it this way - I might say we should fix the token transport to handle this, remove the need for wrap transport, and fix the token.

opened #71713

@smarterclayton
Copy link
Contributor

Follow up with Jordan in #71713 - I think this preserves the desired legacy behavior and is even slightly cleaner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.12 Running in-cluster e2es no longer respects service account RBAC rules.
6 participants