Merge pull request #51034 from wlan0/master

Automatic merge from submit-queue (batch tested with PRs 51034, 53239). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix conditional for warning while starting KCM without secret file

@liggitt @spiffxp @lavalamp 

Fixes #53291

A small bug was introduced in this PR - https://github.com/kubernetes/kubernetes/pull/50288, where the warning message is printed when the file is specified, and it is not printed if it is left blank - exactly the opposite of the intended behavior. 

This fixes that.

```
release-note-none
```
pull/6/head
Kubernetes Submit Queue 2017-09-30 12:14:11 -07:00 committed by GitHub
commit 6cc1816c64
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ func Run(s *options.CMServer) error {
}
var clientBuilder controller.ControllerClientBuilder
if s.UseServiceAccountCredentials {
if len(s.ServiceAccountKeyFile) > 0 {
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")