Add support for ConfigMap keys in env vars

This commit is contained in:
Paul Morie
2015-12-17 15:51:51 -05:00
parent c059dfdb9b
commit 6cfd101251
5 changed files with 161 additions and 11 deletions

View File

@@ -715,9 +715,12 @@ type EnvVar struct {
}
// EnvVarSource represents a source for the value of an EnvVar.
// Only one of its fields may be set.
type EnvVarSource struct {
// Required: Selects a field of the pod; only name and namespace are supported.
FieldRef *ObjectFieldSelector `json:"fieldRef"`
// Selects a field of the pod; only name and namespace are supported.
FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty"`
// Selects a key of a ConfigMap.
ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
}
// ObjectFieldSelector selects an APIVersioned field of an object.
@@ -730,6 +733,14 @@ type ObjectFieldSelector struct {
FieldPath string `json:"fieldPath"`
}
// Selects a key from a ConfigMap.
type ConfigMapKeySelector struct {
// The ConfigMap to select from.
LocalObjectReference `json:",inline"`
// The key to select.
Key string `json:"key"`
}
// HTTPGetAction describes an action based on HTTP Get requests.
type HTTPGetAction struct {
// Optional: Path to access on the HTTP server.