Merge pull request #47417 from xilabao/print-non-existent-key

Automatic merge from submit-queue (batch tested with PRs 47417, 47638, 46930)

print non-existent key in configmap

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #41573

**Special notes for your reviewer**:
carry from #41574
**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-07-16 16:33:01 -07:00 committed by GitHub
commit 1cbb7b1405

View File

@ -266,9 +266,7 @@ func MakePayload(mappings []v1.KeyToPath, configMap *v1.ConfigMap, defaultMode *
if optional {
continue
}
err_msg := "references non-existent config key"
glog.Errorf(err_msg)
return nil, fmt.Errorf(err_msg)
return nil, fmt.Errorf("configmap references non-existent config key: %s", ktp.Key)
}
fileProjection.Data = []byte(content)