From dffee9c06f9728bd107f6cd250cee1ceac08d89f Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Tue, 8 Aug 2017 00:48:17 -0400 Subject: [PATCH] Honor --use-service-account-credentials and warn when missing private key --- cmd/kube-controller-manager/app/controllermanager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go index 7fed178916..c161d3a7c6 100644 --- a/cmd/kube-controller-manager/app/controllermanager.go +++ b/cmd/kube-controller-manager/app/controllermanager.go @@ -163,7 +163,12 @@ func Run(s *options.CMServer) error { ClientConfig: kubeconfig, } 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{ ClientConfig: restclient.AnonymousClientConfig(kubeconfig), CoreClient: kubeClient.CoreV1(),