Merge pull request #46688 from zhangxiaoyu-zidif/change-method-kubectl-configmap

Automatic merge from submit-queue

Fix error message of isDir

**What this PR does / why we need it**:
Use IsRegular to replace isDir
Accoding to the code logic, using IsRegular is proper.
 
**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2017-06-23 01:58:14 -07:00
committed by GitHub

View File

@@ -218,7 +218,7 @@ func handleConfigMapFromEnvFileSource(configMap *api.ConfigMap, envFileSource st
} }
} }
if info.IsDir() { if info.IsDir() {
return fmt.Errorf("must be a file") return fmt.Errorf("env config file cannot be a directory")
} }
return addFromEnvFile(envFileSource, func(key, value string) error { return addFromEnvFile(envFileSource, func(key, value string) error {