mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Honor --use-service-account-credentials and warn when missing private key
This commit is contained in:
parent
0967f9560a
commit
dffee9c06f
@ -163,7 +163,12 @@ func Run(s *options.CMServer) error {
|
|||||||
ClientConfig: kubeconfig,
|
ClientConfig: kubeconfig,
|
||||||
}
|
}
|
||||||
var clientBuilder controller.ControllerClientBuilder
|
var clientBuilder controller.ControllerClientBuilder
|
||||||
if len(s.ServiceAccountKeyFile) > 0 && s.UseServiceAccountCredentials {
|
if s.UseServiceAccountCredentials {
|
||||||
|
if len(s.ServiceAccountKeyFile) > 0 {
|
||||||
|
// It's possible another controller process is creating the tokens for us.
|
||||||
|
// If one isn't, we'll timeout and exit when our client builder is unable to create the tokens.
|
||||||
|
glog.Warningf("--use-service-account-credentials was specified without providing a --service-account-private-key-file")
|
||||||
|
}
|
||||||
clientBuilder = controller.SAControllerClientBuilder{
|
clientBuilder = controller.SAControllerClientBuilder{
|
||||||
ClientConfig: restclient.AnonymousClientConfig(kubeconfig),
|
ClientConfig: restclient.AnonymousClientConfig(kubeconfig),
|
||||||
CoreClient: kubeClient.CoreV1(),
|
CoreClient: kubeClient.CoreV1(),
|
||||||
|
Loading…
Reference in New Issue
Block a user