Skip to content

Commit f08b2b8

Browse files
authored
Merge pull request kubernetes#74160 from mikedanese/updatedoc
clarify PreStop hook intended behavior in doc
2 parents 042f9ed + 729ed4e commit f08b2b8

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

api/openapi-spec/swagger.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/core/types.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,8 +2035,15 @@ type Lifecycle struct {
20352035
// is terminated and restarted.
20362036
// +optional
20372037
PostStart *Handler
2038-
// PreStop is called immediately before a container is terminated. The reason for termination is
2039-
// passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated.
2038+
// PreStop is called immediately before a container is terminated due to an
2039+
// API request or management event such as liveness probe failure,
2040+
// preemption, resource contention, etc. The handler is not called if the
2041+
// container crashes or exits. The reason for termination is passed to the
2042+
// handler. The Pod's termination grace period countdown begins before the
2043+
// PreStop hooked is executed. Regardless of the outcome of the handler, the
2044+
// container will eventually terminate within the Pod's termination grace
2045+
// period. Other management of the container blocks until the hook completes
2046+
// or until the termination grace period is reached.
20402047
// +optional
20412048
PreStop *Handler
20422049
}

staging/src/k8s.io/api/core/v1/generated.proto

Lines changed: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/api/core/v1/types.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,11 +2228,15 @@ type Lifecycle struct {
22282228
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
22292229
// +optional
22302230
PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"`
2231-
// PreStop is called immediately before a container is terminated.
2232-
// The container is terminated after the handler completes.
2233-
// The reason for termination is passed to the handler.
2234-
// Regardless of the outcome of the handler, the container is eventually terminated.
2235-
// Other management of the container blocks until the hook completes.
2231+
// PreStop is called immediately before a container is terminated due to an
2232+
// API request or management event such as liveness probe failure,
2233+
// preemption, resource contention, etc. The handler is not called if the
2234+
// container crashes or exits. The reason for termination is passed to the
2235+
// handler. The Pod's termination grace period countdown begins before the
2236+
// PreStop hooked is executed. Regardless of the outcome of the handler, the
2237+
// container will eventually terminate within the Pod's termination grace
2238+
// period. Other management of the container blocks until the hook completes
2239+
// or until the termination grace period is reached.
22362240
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
22372241
// +optional
22382242
PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"`

staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)