Skip to content

Commit 9a0e368

Browse files
API changes
Kubernetes-commit: 70540c9f43e2fb7604924a120799206c27cbbd28
1 parent f9401a3 commit 9a0e368

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

core/v1/types.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,6 +2980,78 @@ type LifecycleHandler struct {
29802980
Sleep *SleepAction `json:"sleep,omitempty" protobuf:"bytes,4,opt,name=sleep"`
29812981
}
29822982

2983+
// Signal defines the stop signal of containers
2984+
// +enum
2985+
type Signal string
2986+
2987+
const (
2988+
SIGABRT Signal = "SIGABRT"
2989+
SIGALRM Signal = "SIGALRM"
2990+
SIGBUS Signal = "SIGBUS"
2991+
SIGCHLD Signal = "SIGCHLD"
2992+
SIGCLD Signal = "SIGCLD"
2993+
SIGCONT Signal = "SIGCONT"
2994+
SIGFPE Signal = "SIGFPE"
2995+
SIGHUP Signal = "SIGHUP"
2996+
SIGILL Signal = "SIGILL"
2997+
SIGINT Signal = "SIGINT"
2998+
SIGIO Signal = "SIGIO"
2999+
SIGIOT Signal = "SIGIOT"
3000+
SIGKILL Signal = "SIGKILL"
3001+
SIGPIPE Signal = "SIGPIPE"
3002+
SIGPOLL Signal = "SIGPOLL"
3003+
SIGPROF Signal = "SIGPROF"
3004+
SIGPWR Signal = "SIGPWR"
3005+
SIGQUIT Signal = "SIGQUIT"
3006+
SIGSEGV Signal = "SIGSEGV"
3007+
SIGSTKFLT Signal = "SIGSTKFLT"
3008+
SIGSTOP Signal = "SIGSTOP"
3009+
SIGSYS Signal = "SIGSYS"
3010+
SIGTERM Signal = "SIGTERM"
3011+
SIGTRAP Signal = "SIGTRAP"
3012+
SIGTSTP Signal = "SIGTSTP"
3013+
SIGTTIN Signal = "SIGTTIN"
3014+
SIGTTOU Signal = "SIGTTOU"
3015+
SIGURG Signal = "SIGURG"
3016+
SIGUSR1 Signal = "SIGUSR1"
3017+
SIGUSR2 Signal = "SIGUSR2"
3018+
SIGVTALRM Signal = "SIGVTALRM"
3019+
SIGWINCH Signal = "SIGWINCH"
3020+
SIGXCPU Signal = "SIGXCPU"
3021+
SIGXFSZ Signal = "SIGXFSZ"
3022+
SIGRTMIN Signal = "SIGRTMIN"
3023+
SIGRTMINPLUS1 Signal = "SIGRTMIN+1"
3024+
SIGRTMINPLUS2 Signal = "SIGRTMIN+2"
3025+
SIGRTMINPLUS3 Signal = "SIGRTMIN+3"
3026+
SIGRTMINPLUS4 Signal = "SIGRTMIN+4"
3027+
SIGRTMINPLUS5 Signal = "SIGRTMIN+5"
3028+
SIGRTMINPLUS6 Signal = "SIGRTMIN+6"
3029+
SIGRTMINPLUS7 Signal = "SIGRTMIN+7"
3030+
SIGRTMINPLUS8 Signal = "SIGRTMIN+8"
3031+
SIGRTMINPLUS9 Signal = "SIGRTMIN+9"
3032+
SIGRTMINPLUS10 Signal = "SIGRTMIN+10"
3033+
SIGRTMINPLUS11 Signal = "SIGRTMIN+11"
3034+
SIGRTMINPLUS12 Signal = "SIGRTMIN+12"
3035+
SIGRTMINPLUS13 Signal = "SIGRTMIN+13"
3036+
SIGRTMINPLUS14 Signal = "SIGRTMIN+14"
3037+
SIGRTMINPLUS15 Signal = "SIGRTMIN+15"
3038+
SIGRTMAXMINUS14 Signal = "SIGRTMAX-14"
3039+
SIGRTMAXMINUS13 Signal = "SIGRTMAX-13"
3040+
SIGRTMAXMINUS12 Signal = "SIGRTMAX-12"
3041+
SIGRTMAXMINUS11 Signal = "SIGRTMAX-11"
3042+
SIGRTMAXMINUS10 Signal = "SIGRTMAX-10"
3043+
SIGRTMAXMINUS9 Signal = "SIGRTMAX-9"
3044+
SIGRTMAXMINUS8 Signal = "SIGRTMAX-8"
3045+
SIGRTMAXMINUS7 Signal = "SIGRTMAX-7"
3046+
SIGRTMAXMINUS6 Signal = "SIGRTMAX-6"
3047+
SIGRTMAXMINUS5 Signal = "SIGRTMAX-5"
3048+
SIGRTMAXMINUS4 Signal = "SIGRTMAX-4"
3049+
SIGRTMAXMINUS3 Signal = "SIGRTMAX-3"
3050+
SIGRTMAXMINUS2 Signal = "SIGRTMAX-2"
3051+
SIGRTMAXMINUS1 Signal = "SIGRTMAX-1"
3052+
SIGRTMAX Signal = "SIGRTMAX"
3053+
)
3054+
29833055
// Lifecycle describes actions that the management system should take in response to container lifecycle
29843056
// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks
29853057
// until the action is complete, unless the container process fails, in which case the handler is aborted.
@@ -3001,6 +3073,11 @@ type Lifecycle struct {
30013073
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
30023074
// +optional
30033075
PreStop *LifecycleHandler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"`
3076+
// StopSignal defines which signal will be sent to a container when it is being stopped.
3077+
// If not specified, the default is defined by the container runtime in use.
3078+
// StopSignal can only be set for Pods with a non-empty .spec.os.name
3079+
// +optional
3080+
StopSignal *Signal `json:"stopSignal,omitempty" protobuf:"bytes,3,opt,name=stopSignal"`
30043081
}
30053082

30063083
type ConditionStatus string
@@ -3154,6 +3231,10 @@ type ContainerStatus struct {
31543231
// +listType=map
31553232
// +listMapKey=name
31563233
AllocatedResourcesStatus []ResourceStatus `json:"allocatedResourcesStatus,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,14,rep,name=allocatedResourcesStatus"`
3234+
// StopSignal reports the effective stop signal for this container
3235+
// +featureGate=ContainerStopSignals
3236+
// +optional
3237+
StopSignal *Signal `json:"stopSignal,omitempty" protobuf:"bytes,15,opt,name=stopSignal"`
31573238
}
31583239

31593240
// ResourceStatus represents the status of a single resource allocated to a Pod.

0 commit comments

Comments
 (0)