apiserver: make InClusterConfig errs for delegated authn/z non-fatal
Kubernetes-commit: 04e793e65ad70df5c4ab280c42740864e54163cd
This commit is contained in:
parent
c8f47fd79c
commit
1a58e1c6ad
|
@ -364,9 +364,12 @@ func (s *DelegatingAuthenticationOptions) getClient() (kubernetes.Interface, err
|
|||
clientConfig, err = loader.ClientConfig()
|
||||
} else {
|
||||
// without the remote kubeconfig file, try to use the in-cluster config. Most addon API servers will
|
||||
// use this path
|
||||
// use this path. If it is optional, ignore errors.
|
||||
clientConfig, err = rest.InClusterConfig()
|
||||
if err == rest.ErrNotInCluster && s.RemoteKubeConfigFileOptional {
|
||||
if err != nil && s.RemoteKubeConfigFileOptional {
|
||||
if err != rest.ErrNotInCluster {
|
||||
glog.Warningf("failed to read in-cluster kubeconfig for delegated authentication: %v", err)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,9 +151,12 @@ func (s *DelegatingAuthorizationOptions) getClient() (kubernetes.Interface, erro
|
|||
clientConfig, err = loader.ClientConfig()
|
||||
} else {
|
||||
// without the remote kubeconfig file, try to use the in-cluster config. Most addon API servers will
|
||||
// use this path
|
||||
// use this path. If it is optional, ignore errors.
|
||||
clientConfig, err = rest.InClusterConfig()
|
||||
if err == rest.ErrNotInCluster && s.RemoteKubeConfigFileOptional {
|
||||
if err != nil && s.RemoteKubeConfigFileOptional {
|
||||
if err != rest.ErrNotInCluster {
|
||||
glog.Warningf("failed to read in-cluster kubeconfig for delegated authorization: %v", err)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue