Merge pull request #39981 from fraenkel/optional_configmaps_secrets

Automatic merge from submit-queue

Optional configmaps and secrets

Allow configmaps and secrets for environment variables and volume sources to be optional

Implements approved proposal c9f881b7bb

Release note:
```release-note
Volumes and environment variables populated from ConfigMap and Secret objects can now tolerate the named source object or specific keys being missing, by adding `optional: true` to the volume or environment variable source specifications.
```
This commit is contained in:
Kubernetes Submit Queue
2017-01-23 23:06:35 -08:00
committed by GitHub
35 changed files with 3002 additions and 878 deletions

View File

@@ -10746,6 +10746,10 @@
"name": {
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"type": "string"
},
"optional": {
"description": "Specify whether the ConfigMap must be defined",
"type": "boolean"
}
}
},
@@ -10762,6 +10766,10 @@
"name": {
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"type": "string"
},
"optional": {
"description": "Specify whether the ConfigMap or it's key must be defined",
"type": "boolean"
}
}
},
@@ -10801,7 +10809,7 @@
"format": "int32"
},
"items": {
"description": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.",
"description": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.",
"type": "array",
"items": {
"$ref": "#/definitions/v1.KeyToPath"
@@ -10810,6 +10818,10 @@
"name": {
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"type": "string"
},
"optional": {
"description": "Specify whether the ConfigMap or it's keys must be defined",
"type": "boolean"
}
}
},
@@ -12677,6 +12689,10 @@
"name": {
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret must be defined",
"type": "boolean"
}
}
},
@@ -12693,6 +12709,10 @@
"name": {
"description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"type": "string"
},
"optional": {
"description": "Specify whether the Secret or it's key must be defined",
"type": "boolean"
}
}
},
@@ -12732,12 +12752,16 @@
"format": "int32"
},
"items": {
"description": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error. Paths must be relative and may not contain the '..' path or start with '..'.",
"description": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.",
"type": "array",
"items": {
"$ref": "#/definitions/v1.KeyToPath"
}
},
"optional": {
"description": "Specify whether the Secret or it's keys must be defined",
"type": "boolean"
},
"secretName": {
"description": "Name of the secret in the pod's namespace to use. More info: http://kubernetes.io/docs/user-guide/volumes#secrets",
"type": "string"