Merge pull request #74160 from mikedanese/updatedoc

clarify PreStop hook intended behavior in doc
pull/564/head
Kubernetes Prow Robot 2019-02-21 17:47:28 -08:00 committed by GitHub
commit f08b2b8864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 14 deletions

View File

@ -7725,7 +7725,7 @@
}, },
"preStop": { "preStop": {
"$ref": "#/definitions/io.k8s.api.core.v1.Handler", "$ref": "#/definitions/io.k8s.api.core.v1.Handler",
"description": "PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" "description": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks"
} }
}, },
"type": "object" "type": "object"

View File

@ -2035,8 +2035,15 @@ type Lifecycle struct {
// is terminated and restarted. // is terminated and restarted.
// +optional // +optional
PostStart *Handler PostStart *Handler
// PreStop is called immediately before a container is terminated. The reason for termination is // PreStop is called immediately before a container is terminated due to an
// passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. // API request or management event such as liveness probe failure,
// preemption, resource contention, etc. The handler is not called if the
// container crashes or exits. The reason for termination is passed to the
// handler. The Pod's termination grace period countdown begins before the
// PreStop hooked is executed. Regardless of the outcome of the handler, the
// container will eventually terminate within the Pod's termination grace
// period. Other management of the container blocks until the hook completes
// or until the termination grace period is reached.
// +optional // +optional
PreStop *Handler PreStop *Handler
} }

View File

@ -1636,11 +1636,15 @@ message Lifecycle {
// +optional // +optional
optional Handler postStart = 1; optional Handler postStart = 1;
// PreStop is called immediately before a container is terminated. // PreStop is called immediately before a container is terminated due to an
// The container is terminated after the handler completes. // API request or management event such as liveness probe failure,
// The reason for termination is passed to the handler. // preemption, resource contention, etc. The handler is not called if the
// Regardless of the outcome of the handler, the container is eventually terminated. // container crashes or exits. The reason for termination is passed to the
// Other management of the container blocks until the hook completes. // handler. The Pod's termination grace period countdown begins before the
// PreStop hooked is executed. Regardless of the outcome of the handler, the
// container will eventually terminate within the Pod's termination grace
// period. Other management of the container blocks until the hook completes
// or until the termination grace period is reached.
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional // +optional
optional Handler preStop = 2; optional Handler preStop = 2;

View File

@ -2228,11 +2228,15 @@ type Lifecycle struct {
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional // +optional
PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"` PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"`
// PreStop is called immediately before a container is terminated. // PreStop is called immediately before a container is terminated due to an
// The container is terminated after the handler completes. // API request or management event such as liveness probe failure,
// The reason for termination is passed to the handler. // preemption, resource contention, etc. The handler is not called if the
// Regardless of the outcome of the handler, the container is eventually terminated. // container crashes or exits. The reason for termination is passed to the
// Other management of the container blocks until the hook completes. // handler. The Pod's termination grace period countdown begins before the
// PreStop hooked is executed. Regardless of the outcome of the handler, the
// container will eventually terminate within the Pod's termination grace
// period. Other management of the container blocks until the hook completes
// or until the termination grace period is reached.
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional // +optional
PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"` PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"`

View File

@ -824,7 +824,7 @@ func (KeyToPath) SwaggerDoc() map[string]string {
var map_Lifecycle = map[string]string{ var map_Lifecycle = map[string]string{
"": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", "": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.",
"postStart": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", "postStart": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks",
"preStop": "PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", "preStop": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks",
} }
func (Lifecycle) SwaggerDoc() map[string]string { func (Lifecycle) SwaggerDoc() map[string]string {