Commit ea18d5c3 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39686 from deads2k/rbac-38-snip-bad-dep

Automatic merge from submit-queue (batch tested with PRs 39673, 39536, 39617, 39540, 39686) remove API to server library dependency A client library (which must include api types), should not depend on our server library. This duplicates one constant for conversion to avoid the link. @smarterclayton @liggitt The import-boss rule to keep us from forming these dependencies is non-trivial since some of the bits under /apis are server only (validation for instance).
parents 748e8f6b b26e9dce
......@@ -35,7 +35,6 @@ go_library(
"//pkg/types:go_default_library",
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/ugorji/go/codec",
"//vendor:k8s.io/apiserver/pkg/authentication/user",
],
)
......
......@@ -17,11 +17,14 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apiserver/pkg/authentication/user"
api "k8s.io/kubernetes/pkg/apis/rbac"
"k8s.io/kubernetes/pkg/conversion"
)
// allAuthenticated matches k8s.io/apiserver/pkg/authentication/user.AllAuthenticated,
// but we don't want an client library (which must include types), depending on a server library
const allAuthenticated = "system:authenticated"
func Convert_v1alpha1_Subject_To_rbac_Subject(in *Subject, out *api.Subject, s conversion.Scope) error {
if err := autoConvert_v1alpha1_Subject_To_rbac_Subject(in, out, s); err != nil {
return err
......@@ -32,7 +35,7 @@ func Convert_v1alpha1_Subject_To_rbac_Subject(in *Subject, out *api.Subject, s c
// Special treatment for * should not be included in v1beta1
if out.Kind == UserKind && out.Name == "*" {
out.Kind = GroupKind
out.Name = user.AllAuthenticated
out.Name = allAuthenticated
}
return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment