Remove assigning by default first alphabetical kube cluster to a user.#37242
Remove assigning by default first alphabetical kube cluster to a user.#37242
Conversation
2503915 to
f43e781
Compare
tigrato
left a comment
There was a problem hiding this comment.
This looks good to me.
Did you tested with legacy kubernetes proxy?
| @@ -740,21 +739,6 @@ func (f *Forwarder) setupContext( | |||
| } | |||
|
|
|||
| kubeCluster := identity.KubernetesCluster | |||
There was a problem hiding this comment.
this block can move the the var now that's not used anymore
There was a problem hiding this comment.
It's still useful as a shorthand, since it's used several times down the code.
0e9258f to
6484994
Compare
There was a problem hiding this comment.
| return trace.BadParameter("Kubernetes cluster %q is not registered in this teleport cluster; you can list registered kubernetes clusters using 'tsh kube ls'", kubeClusterName) | |
| return trace.BadParameter("kubernetes cluster %q is not registered in this teleport cluster; you can list registered kubernetes clusters using 'tsh kube ls'", kubeClusterName) |
There was a problem hiding this comment.
In this case it's capitalization of a proper name.
There was a problem hiding this comment.
How come we aren't capitalizing Kubernetes the second time it appears in the message then?
There was a problem hiding this comment.
Oh, we should. 😅 I moved the error and didn't notice it had second usage down the text. Fixed.
6484994 to
33e61ff
Compare
33ef58e to
cad4924
Compare
|
@tigrato yep, I tried with legacy kube proxy config and it works. |
|
Flaky test detector is failing because of 10 minutes timeout. |
bdf1f39 to
0b9d5b8
Compare
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
97ef1f1 to
f9f4bfc
Compare
|
/excludeflake * |
#37242) * Remove assigning by default first alphabetical kube cluster to a user. * Fix tests. * Address review comments * Fix tests. * Fix error message. * Use default value. Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> * Fix error message. Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
#37242) * Remove assigning by default first alphabetical kube cluster to a user. * Fix tests. * Address review comments * Fix tests. * Fix error message. * Use default value. Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> * Fix error message. Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com> --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
#37242) (#37503) * Remove assigning by default first alphabetical kube cluster to a user. * Fix tests. * Address review comments * Fix tests. * Fix error message. * Use default value. * Fix error message. --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
#37242) (#37501) * Remove assigning by default first alphabetical kube cluster to a user. * Fix tests. * Address review comments * Fix tests. * Fix error message. * Use default value. * Fix error message. --------- Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
As a leftover of initial kube access implementation, we were setting first alphabetical kube cluster to a user's certificate, even if they didn't have access to it. It lead to unnecessary leaking of a name of existing kube cluster. This PR removes assignment of a default cluster and we only check if specified cluster is available. Also removes redundant check from kube forwarder, since kube cluster name should never be empty there (and kube cluster presence is checked further in the code).
Changelog: Do not add alphabetically first Kube cluster's name to a user certificate on login.
Fixes https://github.com/gravitational/teleport-private/issues/1319