mirror of https://github.com/containers/podman.git
Merge pull request #13325 from xordspar0/configmap-error-msg
Improve the error message for usused configMaps
This commit is contained in:
commit
874bde2050
|
@ -72,9 +72,11 @@ disable builds.
|
||||||
|
|
||||||
`Kubernetes ConfigMap`
|
`Kubernetes ConfigMap`
|
||||||
|
|
||||||
Kubernetes ConfigMap can be referred as a source of environment variables in Pods or Deployments.
|
Kubernetes ConfigMap can be referred as a source of environment variables or volumes in Pods or Deployments.
|
||||||
|
ConfigMaps aren't a standalone object in Podman; instead, when a container uses a ConfigMap, Podman will create environment variables or volumes as needed.
|
||||||
|
|
||||||
|
For example, the following YAML document defines a ConfigMap and then uses it in a Pod:
|
||||||
|
|
||||||
For example ConfigMap defined in following YAML:
|
|
||||||
```
|
```
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
|
@ -82,14 +84,11 @@ metadata:
|
||||||
name: foo
|
name: foo
|
||||||
data:
|
data:
|
||||||
FOO: bar
|
FOO: bar
|
||||||
```
|
---
|
||||||
|
|
||||||
can be referred in a Pod in following way:
|
|
||||||
```
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
...
|
name: foobar
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- command:
|
- command:
|
||||||
|
|
|
@ -128,6 +128,9 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, path string, options en
|
||||||
}
|
}
|
||||||
|
|
||||||
if validKinds == 0 {
|
if validKinds == 0 {
|
||||||
|
if len(configMaps) > 0 {
|
||||||
|
return nil, fmt.Errorf("ConfigMaps in podman are not a standalone object and must be used in a container")
|
||||||
|
}
|
||||||
return nil, fmt.Errorf("YAML document does not contain any supported kube kind")
|
return nil, fmt.Errorf("YAML document does not contain any supported kube kind")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue