Honor --use-service-account-credentials and warn when missing private key

pull/6/head
Jordan Liggitt 2017-08-08 00:48:17 -04:00
parent 0967f9560a
commit dffee9c06f
No known key found for this signature in database
GPG Key ID: 39928704103C7229
1 changed files with 6 additions and 1 deletions

View File

@ -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(),