From 8ec769da6bd63eac2af54139e2c9c42caefd9abf Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Wed, 6 Sep 2017 18:15:43 +0200 Subject: [PATCH] apiserver: allow disabling authz/n via options Kubernetes-commit: dffe50f8bd820295f7f1fbc56a6269b6b8c6966b --- pkg/server/options/authentication.go | 5 +++++ pkg/server/options/authorization.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkg/server/options/authentication.go b/pkg/server/options/authentication.go index 1a5c728c5..624343fc4 100644 --- a/pkg/server/options/authentication.go +++ b/pkg/server/options/authentication.go @@ -143,6 +143,11 @@ func (s *DelegatingAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { } func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.Config) error { + if s == nil { + c.Authenticator = nil + return nil + } + clientCA, err := s.getClientCA() if err != nil { return err diff --git a/pkg/server/options/authorization.go b/pkg/server/options/authorization.go index ddc32fc90..3d356958f 100644 --- a/pkg/server/options/authorization.go +++ b/pkg/server/options/authorization.go @@ -71,6 +71,11 @@ func (s *DelegatingAuthorizationOptions) AddFlags(fs *pflag.FlagSet) { } func (s *DelegatingAuthorizationOptions) ApplyTo(c *server.Config) error { + if s == nil { + c.Authorizer = authorizerfactory.NewAlwaysAllowAuthorizer() + return nil + } + cfg, err := s.ToAuthorizationConfig() if err != nil { return err