De-share the Handler struct in core API (#105979)

* De-share the Handler struct in core API

An upcoming PR adds a handler that only applies on one of these paths.
Having fields that don't work seems bad.

This never should have been shared.  Lifecycle hooks are like a "write"
while probes are more like a "read". HTTPGet and TCPSocket don't really
make sense as lifecycle hooks (but I can't take that back). When we add
gRPC, it is EXPLICITLY a health check (defined by gRPC) not an arbitrary
RPC - so a probe makes sense but a hook does not.

In the future I can also see adding lifecycle hooks that don't make
sense as probes.  E.g. 'sleep' is a common lifecycle request. The only
option is `exec`, which requires having a sleep binary in your image.

* Run update scripts
This commit is contained in:
Tim Hockin 2021-10-29 13:15:11 -07:00 committed by GitHub
parent adff4a75ad
commit 11a25bfeb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 2625 additions and 2093 deletions

View File

@ -6003,24 +6003,6 @@
],
"type": "object"
},
"io.k8s.api.core.v1.Handler": {
"description": "Handler defines a specific action that should be taken",
"properties": {
"exec": {
"$ref": "#/definitions/io.k8s.api.core.v1.ExecAction",
"description": "One and only one of the following should be specified. Exec specifies the action to take."
},
"httpGet": {
"$ref": "#/definitions/io.k8s.api.core.v1.HTTPGetAction",
"description": "HTTPGet specifies the http request to perform."
},
"tcpSocket": {
"$ref": "#/definitions/io.k8s.api.core.v1.TCPSocketAction",
"description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported"
}
},
"type": "object"
},
"io.k8s.api.core.v1.HostAlias": {
"description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.",
"properties": {
@ -6200,16 +6182,34 @@
"description": "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.",
"properties": {
"postStart": {
"$ref": "#/definitions/io.k8s.api.core.v1.Handler",
"$ref": "#/definitions/io.k8s.api.core.v1.LifecycleHandler",
"description": "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": {
"$ref": "#/definitions/io.k8s.api.core.v1.Handler",
"$ref": "#/definitions/io.k8s.api.core.v1.LifecycleHandler",
"description": "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup 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"
},
"io.k8s.api.core.v1.LifecycleHandler": {
"description": "LifecycleHandler defines a specific action that should be taken in a lifecycle hook. This type has a strong relationship to ProbeHandler - overlapping fields should be identical.",
"properties": {
"exec": {
"$ref": "#/definitions/io.k8s.api.core.v1.ExecAction",
"description": "One and only one of the following should be specified. Exec specifies the action to take."
},
"httpGet": {
"$ref": "#/definitions/io.k8s.api.core.v1.HTTPGetAction",
"description": "HTTPGet specifies the http request to perform."
},
"tcpSocket": {
"$ref": "#/definitions/io.k8s.api.core.v1.TCPSocketAction",
"description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported"
}
},
"type": "object"
},
"io.k8s.api.core.v1.LimitRange": {
"description": "LimitRange sets resource usage limits for each kind of resource in a Namespace.",
"properties": {

View File

@ -271,7 +271,7 @@ func StartupProbe(host, path string, port int, scheme v1.URIScheme, timeoutForCo
func createHTTPProbe(host, path string, port int, scheme v1.URIScheme, initialDelaySeconds, timeoutSeconds, failureThreshold, periodSeconds int32) *v1.Probe {
return &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Host: host,
Path: path,

View File

@ -124,20 +124,20 @@ func SetObjectDefaults_DaemonSet(in *v1.DaemonSet) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -174,20 +174,20 @@ func SetObjectDefaults_DaemonSet(in *v1.DaemonSet) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -224,20 +224,20 @@ func SetObjectDefaults_DaemonSet(in *v1.DaemonSet) {
corev1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -345,20 +345,20 @@ func SetObjectDefaults_Deployment(in *v1.Deployment) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -395,20 +395,20 @@ func SetObjectDefaults_Deployment(in *v1.Deployment) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -445,20 +445,20 @@ func SetObjectDefaults_Deployment(in *v1.Deployment) {
corev1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -566,20 +566,20 @@ func SetObjectDefaults_ReplicaSet(in *v1.ReplicaSet) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -616,20 +616,20 @@ func SetObjectDefaults_ReplicaSet(in *v1.ReplicaSet) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -666,20 +666,20 @@ func SetObjectDefaults_ReplicaSet(in *v1.ReplicaSet) {
corev1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -787,20 +787,20 @@ func SetObjectDefaults_StatefulSet(in *v1.StatefulSet) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -837,20 +837,20 @@ func SetObjectDefaults_StatefulSet(in *v1.StatefulSet) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -887,20 +887,20 @@ func SetObjectDefaults_StatefulSet(in *v1.StatefulSet) {
corev1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -120,20 +120,20 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -170,20 +170,20 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -220,20 +220,20 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -341,20 +341,20 @@ func SetObjectDefaults_StatefulSet(in *v1beta1.StatefulSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -391,20 +391,20 @@ func SetObjectDefaults_StatefulSet(in *v1beta1.StatefulSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -441,20 +441,20 @@ func SetObjectDefaults_StatefulSet(in *v1beta1.StatefulSet) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -124,20 +124,20 @@ func SetObjectDefaults_DaemonSet(in *v1beta2.DaemonSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -174,20 +174,20 @@ func SetObjectDefaults_DaemonSet(in *v1beta2.DaemonSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -224,20 +224,20 @@ func SetObjectDefaults_DaemonSet(in *v1beta2.DaemonSet) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -345,20 +345,20 @@ func SetObjectDefaults_Deployment(in *v1beta2.Deployment) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -395,20 +395,20 @@ func SetObjectDefaults_Deployment(in *v1beta2.Deployment) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -445,20 +445,20 @@ func SetObjectDefaults_Deployment(in *v1beta2.Deployment) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -566,20 +566,20 @@ func SetObjectDefaults_ReplicaSet(in *v1beta2.ReplicaSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -616,20 +616,20 @@ func SetObjectDefaults_ReplicaSet(in *v1beta2.ReplicaSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -666,20 +666,20 @@ func SetObjectDefaults_ReplicaSet(in *v1beta2.ReplicaSet) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -787,20 +787,20 @@ func SetObjectDefaults_StatefulSet(in *v1beta2.StatefulSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -837,20 +837,20 @@ func SetObjectDefaults_StatefulSet(in *v1beta2.StatefulSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -887,20 +887,20 @@ func SetObjectDefaults_StatefulSet(in *v1beta2.StatefulSet) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -120,20 +120,20 @@ func SetObjectDefaults_CronJob(in *v1.CronJob) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -170,20 +170,20 @@ func SetObjectDefaults_CronJob(in *v1.CronJob) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -220,20 +220,20 @@ func SetObjectDefaults_CronJob(in *v1.CronJob) {
corev1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -341,20 +341,20 @@ func SetObjectDefaults_Job(in *v1.Job) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -391,20 +391,20 @@ func SetObjectDefaults_Job(in *v1.Job) {
corev1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
corev1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -441,20 +441,20 @@ func SetObjectDefaults_Job(in *v1.Job) {
corev1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
corev1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
corev1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -119,20 +119,20 @@ func SetObjectDefaults_CronJob(in *v1beta1.CronJob) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -169,20 +169,20 @@ func SetObjectDefaults_CronJob(in *v1beta1.CronJob) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -219,20 +219,20 @@ func SetObjectDefaults_CronJob(in *v1beta1.CronJob) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -339,20 +339,20 @@ func SetObjectDefaults_JobTemplate(in *v1beta1.JobTemplate) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -389,20 +389,20 @@ func SetObjectDefaults_JobTemplate(in *v1beta1.JobTemplate) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -439,20 +439,20 @@ func SetObjectDefaults_JobTemplate(in *v1beta1.JobTemplate) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -2022,7 +2022,7 @@ type ExecAction struct {
// alive or ready to receive traffic.
type Probe struct {
// The action taken to determine the health of a container
Handler
ProbeHandler
// Length of time before health checking is activated. In seconds.
// +optional
InitialDelaySeconds int32
@ -2188,9 +2188,29 @@ type Container struct {
TTY bool
}
// Handler defines a specific action that should be taken
// ProbeHandler defines a specific action that should be taken in a probe.
// This type has a strong relationship to LifecycleHandler - overlapping fields
// should be identical.
// TODO: pass structured data to these actions, and document that data here.
type Handler struct {
type ProbeHandler struct {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
Exec *ExecAction
// HTTPGet specifies the http request to perform.
// +optional
HTTPGet *HTTPGetAction
// TCPSocket specifies an action involving a TCP port.
// TODO: implement a realistic TCP lifecycle hook
// +optional
TCPSocket *TCPSocketAction
}
// LifecycleHandler defines a specific action that should be taken in a lifecycle
// hook. This type has a strong relationship to ProbeHandler - overlapping fields
// should be identical.
// TODO: pass structured data to these actions, and document that data here.
type LifecycleHandler struct {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
@ -2211,7 +2231,7 @@ type Lifecycle struct {
// PostStart is called immediately after a container is created. If the handler fails, the container
// is terminated and restarted.
// +optional
PostStart *Handler
PostStart *LifecycleHandler
// PreStop is called immediately before a container is terminated due to an
// API request or management event such as liveness/startup probe failure,
// preemption, resource contention, etc. The handler is not called if the
@ -2222,7 +2242,7 @@ type Lifecycle struct {
// period. Other management of the container blocks until the hook completes
// or until the termination grace period is reached.
// +optional
PreStop *Handler
PreStop *LifecycleHandler
}
// The below types are used by kube_client and api_server.

View File

@ -51,88 +51,88 @@ func TestWorkloadDefaults(t *testing.T) {
// Forbidden: changing an existing default value
// Allowed: adding a new field `MyContainer *MyType` and defaulting a child of that type (e.g. `MyContainer.MyChildField`) if and only if MyContainer is non-nil
expectedDefaults := map[string]string{
".Spec.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.Containers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.Containers[0].LivenessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].LivenessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].Ports[0].Protocol": `"TCP"`,
".Spec.Containers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.Containers[0].ReadinessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].ReadinessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].StartupProbe.FailureThreshold": "3",
".Spec.Containers[0].StartupProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].StartupProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].StartupProbe.PeriodSeconds": "10",
".Spec.Containers[0].StartupProbe.SuccessThreshold": "1",
".Spec.Containers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.Containers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.Containers[0].TerminationMessagePolicy": `"File"`,
".Spec.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.Containers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.Containers[0].LivenessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].LivenessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].Ports[0].Protocol": `"TCP"`,
".Spec.Containers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.Containers[0].ReadinessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].ReadinessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].StartupProbe.FailureThreshold": "3",
".Spec.Containers[0].StartupProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].StartupProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].StartupProbe.PeriodSeconds": "10",
".Spec.Containers[0].StartupProbe.SuccessThreshold": "1",
".Spec.Containers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.Containers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.Containers[0].TerminationMessagePolicy": `"File"`,
".Spec.DNSPolicy": `"ClusterFirst"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ImagePullPolicy": `"IfNotPresent"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Ports[0].Protocol": `"TCP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePath": `"/dev/termination-log"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePolicy": `"File"`,
".Spec.InitContainers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.InitContainers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].LivenessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].LivenessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].Ports[0].Protocol": `"TCP"`,
".Spec.InitContainers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].ReadinessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].ReadinessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].StartupProbe.FailureThreshold": "3",
".Spec.InitContainers[0].StartupProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].StartupProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].StartupProbe.PeriodSeconds": "10",
".Spec.InitContainers[0].StartupProbe.SuccessThreshold": "1",
".Spec.InitContainers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.InitContainers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.InitContainers[0].TerminationMessagePolicy": `"File"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ImagePullPolicy": `"IfNotPresent"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Ports[0].Protocol": `"TCP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePath": `"/dev/termination-log"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePolicy": `"File"`,
".Spec.InitContainers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.InitContainers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].LivenessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].LivenessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].Ports[0].Protocol": `"TCP"`,
".Spec.InitContainers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].ReadinessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].ReadinessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].StartupProbe.FailureThreshold": "3",
".Spec.InitContainers[0].StartupProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].StartupProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].StartupProbe.PeriodSeconds": "10",
".Spec.InitContainers[0].StartupProbe.SuccessThreshold": "1",
".Spec.InitContainers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.InitContainers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.InitContainers[0].TerminationMessagePolicy": `"File"`,
".Spec.RestartPolicy": `"Always"`,
".Spec.SchedulerName": `"default-scheduler"`,
".Spec.SecurityContext": `{}`,
@ -175,91 +175,91 @@ func TestPodDefaults(t *testing.T) {
// Forbidden: changing an existing default value
// Allowed: adding a new field `MyContainer *MyType` and defaulting a child of that type (e.g. `MyContainer.MyChildField`) if and only if MyContainer is non-nil
expectedDefaults := map[string]string{
".Spec.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.Containers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.Containers[0].LivenessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].LivenessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].Ports[0].Protocol": `"TCP"`,
".Spec.Containers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.Containers[0].ReadinessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].ReadinessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].Resources.Requests": `{"":"0"}`, // this gets defaulted from the limits field
".Spec.Containers[0].StartupProbe.FailureThreshold": "3",
".Spec.Containers[0].StartupProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].StartupProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].StartupProbe.PeriodSeconds": "10",
".Spec.Containers[0].StartupProbe.SuccessThreshold": "1",
".Spec.Containers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.Containers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.Containers[0].TerminationMessagePolicy": `"File"`,
".Spec.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.Containers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.Containers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.Containers[0].LivenessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].LivenessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].Ports[0].Protocol": `"TCP"`,
".Spec.Containers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.Containers[0].ReadinessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].ReadinessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.Containers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.Containers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.Containers[0].Resources.Requests": `{"":"0"}`, // this gets defaulted from the limits field
".Spec.Containers[0].StartupProbe.FailureThreshold": "3",
".Spec.Containers[0].StartupProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.Containers[0].StartupProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.Containers[0].StartupProbe.PeriodSeconds": "10",
".Spec.Containers[0].StartupProbe.SuccessThreshold": "1",
".Spec.Containers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.Containers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.Containers[0].TerminationMessagePolicy": `"File"`,
".Spec.DNSPolicy": `"ClusterFirst"`,
".Spec.EnableServiceLinks": `true`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ImagePullPolicy": `"IfNotPresent"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Ports[0].Protocol": `"TCP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePath": `"/dev/termination-log"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePolicy": `"File"`,
".Spec.InitContainers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.InitContainers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].LivenessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].LivenessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].Ports[0].Protocol": `"TCP"`,
".Spec.InitContainers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].ReadinessProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].ReadinessProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].Resources.Requests": `{"":"0"}`, // this gets defaulted from the limits field
".Spec.InitContainers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.InitContainers[0].TerminationMessagePolicy": `"File"`,
".Spec.InitContainers[0].StartupProbe.FailureThreshold": "3",
".Spec.InitContainers[0].StartupProbe.Handler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].StartupProbe.Handler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].StartupProbe.PeriodSeconds": "10",
".Spec.InitContainers[0].StartupProbe.SuccessThreshold": "1",
".Spec.InitContainers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ImagePullPolicy": `"IfNotPresent"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.LivenessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.Ports[0].Protocol": `"TCP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.ReadinessProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.FailureThreshold": "3",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.PeriodSeconds": "10",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.SuccessThreshold": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.StartupProbe.TimeoutSeconds": "1",
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePath": `"/dev/termination-log"`,
".Spec.EphemeralContainers[0].EphemeralContainerCommon.TerminationMessagePolicy": `"File"`,
".Spec.InitContainers[0].Env[0].ValueFrom.FieldRef.APIVersion": `"v1"`,
".Spec.InitContainers[0].ImagePullPolicy": `"IfNotPresent"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PostStart.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].Lifecycle.PreStop.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].LivenessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].LivenessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].LivenessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].LivenessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].LivenessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].Ports[0].Protocol": `"TCP"`,
".Spec.InitContainers[0].ReadinessProbe.FailureThreshold": `3`,
".Spec.InitContainers[0].ReadinessProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].ReadinessProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].ReadinessProbe.PeriodSeconds": `10`,
".Spec.InitContainers[0].ReadinessProbe.SuccessThreshold": `1`,
".Spec.InitContainers[0].ReadinessProbe.TimeoutSeconds": `1`,
".Spec.InitContainers[0].Resources.Requests": `{"":"0"}`, // this gets defaulted from the limits field
".Spec.InitContainers[0].TerminationMessagePath": `"/dev/termination-log"`,
".Spec.InitContainers[0].TerminationMessagePolicy": `"File"`,
".Spec.InitContainers[0].StartupProbe.FailureThreshold": "3",
".Spec.InitContainers[0].StartupProbe.ProbeHandler.HTTPGet.Path": `"/"`,
".Spec.InitContainers[0].StartupProbe.ProbeHandler.HTTPGet.Scheme": `"HTTP"`,
".Spec.InitContainers[0].StartupProbe.PeriodSeconds": "10",
".Spec.InitContainers[0].StartupProbe.SuccessThreshold": "1",
".Spec.InitContainers[0].StartupProbe.TimeoutSeconds": "1",
".Spec.RestartPolicy": `"Always"`,
".Spec.SchedulerName": `"default-scheduler"`,
".Spec.SecurityContext": `{}`,
@ -676,8 +676,8 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
assertProb := func(got, expected *v1.Container) error {
// Assert LivenessProbe
if got.LivenessProbe.Handler.HTTPGet.Path != expected.LivenessProbe.Handler.HTTPGet.Path ||
got.LivenessProbe.Handler.HTTPGet.Scheme != expected.LivenessProbe.Handler.HTTPGet.Scheme ||
if got.LivenessProbe.ProbeHandler.HTTPGet.Path != expected.LivenessProbe.ProbeHandler.HTTPGet.Path ||
got.LivenessProbe.ProbeHandler.HTTPGet.Scheme != expected.LivenessProbe.ProbeHandler.HTTPGet.Scheme ||
got.LivenessProbe.FailureThreshold != expected.LivenessProbe.FailureThreshold ||
got.LivenessProbe.SuccessThreshold != expected.LivenessProbe.SuccessThreshold ||
got.LivenessProbe.PeriodSeconds != expected.LivenessProbe.PeriodSeconds ||
@ -686,8 +686,8 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
}
// Assert ReadinessProbe
if got.ReadinessProbe.Handler.HTTPGet.Path != expected.ReadinessProbe.Handler.HTTPGet.Path ||
got.ReadinessProbe.Handler.HTTPGet.Scheme != expected.ReadinessProbe.Handler.HTTPGet.Scheme ||
if got.ReadinessProbe.ProbeHandler.HTTPGet.Path != expected.ReadinessProbe.ProbeHandler.HTTPGet.Path ||
got.ReadinessProbe.ProbeHandler.HTTPGet.Scheme != expected.ReadinessProbe.ProbeHandler.HTTPGet.Scheme ||
got.ReadinessProbe.FailureThreshold != expected.ReadinessProbe.FailureThreshold ||
got.ReadinessProbe.SuccessThreshold != expected.ReadinessProbe.SuccessThreshold ||
got.ReadinessProbe.PeriodSeconds != expected.ReadinessProbe.PeriodSeconds ||
@ -869,14 +869,14 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
Name: "fun",
Image: "alpine",
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "localhost",
},
},
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "localhost",
},
@ -891,7 +891,7 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
expected: []v1.Container{
{
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/",
Scheme: v1.URISchemeHTTP,
@ -903,7 +903,7 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
FailureThreshold: 3,
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/",
Scheme: v1.URISchemeHTTP,
@ -934,12 +934,12 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
},
},
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "localhost",
},
},
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "localhost",
},
@ -954,13 +954,13 @@ func TestSetDefaultReplicationControllerInitContainers(t *testing.T) {
expected: []v1.Container{
{
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/",
Scheme: v1.URISchemeHTTP,
},
},
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/",
Scheme: v1.URISchemeHTTP,

View File

@ -692,16 +692,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.Handler)(nil), (*core.Handler)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_Handler_To_core_Handler(a.(*v1.Handler), b.(*core.Handler), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*core.Handler)(nil), (*v1.Handler)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_core_Handler_To_v1_Handler(a.(*core.Handler), b.(*v1.Handler), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.HostAlias)(nil), (*core.HostAlias)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_HostAlias_To_core_HostAlias(a.(*v1.HostAlias), b.(*core.HostAlias), scope)
}); err != nil {
@ -762,6 +752,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.LifecycleHandler)(nil), (*core.LifecycleHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_LifecycleHandler_To_core_LifecycleHandler(a.(*v1.LifecycleHandler), b.(*core.LifecycleHandler), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*core.LifecycleHandler)(nil), (*v1.LifecycleHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_core_LifecycleHandler_To_v1_LifecycleHandler(a.(*core.LifecycleHandler), b.(*v1.LifecycleHandler), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.LimitRange)(nil), (*core.LimitRange)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_LimitRange_To_core_LimitRange(a.(*v1.LimitRange), b.(*core.LimitRange), scope)
}); err != nil {
@ -1452,6 +1452,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.ProbeHandler)(nil), (*core.ProbeHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ProbeHandler_To_core_ProbeHandler(a.(*v1.ProbeHandler), b.(*core.ProbeHandler), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*core.ProbeHandler)(nil), (*v1.ProbeHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_core_ProbeHandler_To_v1_ProbeHandler(a.(*core.ProbeHandler), b.(*v1.ProbeHandler), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.ProjectedVolumeSource)(nil), (*core.ProjectedVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(a.(*v1.ProjectedVolumeSource), b.(*core.ProjectedVolumeSource), scope)
}); err != nil {
@ -3941,30 +3951,6 @@ func Convert_core_HTTPHeader_To_v1_HTTPHeader(in *core.HTTPHeader, out *v1.HTTPH
return autoConvert_core_HTTPHeader_To_v1_HTTPHeader(in, out, s)
}
func autoConvert_v1_Handler_To_core_Handler(in *v1.Handler, out *core.Handler, s conversion.Scope) error {
out.Exec = (*core.ExecAction)(unsafe.Pointer(in.Exec))
out.HTTPGet = (*core.HTTPGetAction)(unsafe.Pointer(in.HTTPGet))
out.TCPSocket = (*core.TCPSocketAction)(unsafe.Pointer(in.TCPSocket))
return nil
}
// Convert_v1_Handler_To_core_Handler is an autogenerated conversion function.
func Convert_v1_Handler_To_core_Handler(in *v1.Handler, out *core.Handler, s conversion.Scope) error {
return autoConvert_v1_Handler_To_core_Handler(in, out, s)
}
func autoConvert_core_Handler_To_v1_Handler(in *core.Handler, out *v1.Handler, s conversion.Scope) error {
out.Exec = (*v1.ExecAction)(unsafe.Pointer(in.Exec))
out.HTTPGet = (*v1.HTTPGetAction)(unsafe.Pointer(in.HTTPGet))
out.TCPSocket = (*v1.TCPSocketAction)(unsafe.Pointer(in.TCPSocket))
return nil
}
// Convert_core_Handler_To_v1_Handler is an autogenerated conversion function.
func Convert_core_Handler_To_v1_Handler(in *core.Handler, out *v1.Handler, s conversion.Scope) error {
return autoConvert_core_Handler_To_v1_Handler(in, out, s)
}
func autoConvert_v1_HostAlias_To_core_HostAlias(in *v1.HostAlias, out *core.HostAlias, s conversion.Scope) error {
out.IP = in.IP
out.Hostnames = *(*[]string)(unsafe.Pointer(&in.Hostnames))
@ -4114,8 +4100,8 @@ func Convert_core_KeyToPath_To_v1_KeyToPath(in *core.KeyToPath, out *v1.KeyToPat
}
func autoConvert_v1_Lifecycle_To_core_Lifecycle(in *v1.Lifecycle, out *core.Lifecycle, s conversion.Scope) error {
out.PostStart = (*core.Handler)(unsafe.Pointer(in.PostStart))
out.PreStop = (*core.Handler)(unsafe.Pointer(in.PreStop))
out.PostStart = (*core.LifecycleHandler)(unsafe.Pointer(in.PostStart))
out.PreStop = (*core.LifecycleHandler)(unsafe.Pointer(in.PreStop))
return nil
}
@ -4125,8 +4111,8 @@ func Convert_v1_Lifecycle_To_core_Lifecycle(in *v1.Lifecycle, out *core.Lifecycl
}
func autoConvert_core_Lifecycle_To_v1_Lifecycle(in *core.Lifecycle, out *v1.Lifecycle, s conversion.Scope) error {
out.PostStart = (*v1.Handler)(unsafe.Pointer(in.PostStart))
out.PreStop = (*v1.Handler)(unsafe.Pointer(in.PreStop))
out.PostStart = (*v1.LifecycleHandler)(unsafe.Pointer(in.PostStart))
out.PreStop = (*v1.LifecycleHandler)(unsafe.Pointer(in.PreStop))
return nil
}
@ -4135,6 +4121,30 @@ func Convert_core_Lifecycle_To_v1_Lifecycle(in *core.Lifecycle, out *v1.Lifecycl
return autoConvert_core_Lifecycle_To_v1_Lifecycle(in, out, s)
}
func autoConvert_v1_LifecycleHandler_To_core_LifecycleHandler(in *v1.LifecycleHandler, out *core.LifecycleHandler, s conversion.Scope) error {
out.Exec = (*core.ExecAction)(unsafe.Pointer(in.Exec))
out.HTTPGet = (*core.HTTPGetAction)(unsafe.Pointer(in.HTTPGet))
out.TCPSocket = (*core.TCPSocketAction)(unsafe.Pointer(in.TCPSocket))
return nil
}
// Convert_v1_LifecycleHandler_To_core_LifecycleHandler is an autogenerated conversion function.
func Convert_v1_LifecycleHandler_To_core_LifecycleHandler(in *v1.LifecycleHandler, out *core.LifecycleHandler, s conversion.Scope) error {
return autoConvert_v1_LifecycleHandler_To_core_LifecycleHandler(in, out, s)
}
func autoConvert_core_LifecycleHandler_To_v1_LifecycleHandler(in *core.LifecycleHandler, out *v1.LifecycleHandler, s conversion.Scope) error {
out.Exec = (*v1.ExecAction)(unsafe.Pointer(in.Exec))
out.HTTPGet = (*v1.HTTPGetAction)(unsafe.Pointer(in.HTTPGet))
out.TCPSocket = (*v1.TCPSocketAction)(unsafe.Pointer(in.TCPSocket))
return nil
}
// Convert_core_LifecycleHandler_To_v1_LifecycleHandler is an autogenerated conversion function.
func Convert_core_LifecycleHandler_To_v1_LifecycleHandler(in *core.LifecycleHandler, out *v1.LifecycleHandler, s conversion.Scope) error {
return autoConvert_core_LifecycleHandler_To_v1_LifecycleHandler(in, out, s)
}
func autoConvert_v1_LimitRange_To_core_LimitRange(in *v1.LimitRange, out *core.LimitRange, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_LimitRangeSpec_To_core_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil {
@ -6462,7 +6472,7 @@ func Convert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in *core
}
func autoConvert_v1_Probe_To_core_Probe(in *v1.Probe, out *core.Probe, s conversion.Scope) error {
if err := Convert_v1_Handler_To_core_Handler(&in.Handler, &out.Handler, s); err != nil {
if err := Convert_v1_ProbeHandler_To_core_ProbeHandler(&in.ProbeHandler, &out.ProbeHandler, s); err != nil {
return err
}
out.InitialDelaySeconds = in.InitialDelaySeconds
@ -6480,7 +6490,7 @@ func Convert_v1_Probe_To_core_Probe(in *v1.Probe, out *core.Probe, s conversion.
}
func autoConvert_core_Probe_To_v1_Probe(in *core.Probe, out *v1.Probe, s conversion.Scope) error {
if err := Convert_core_Handler_To_v1_Handler(&in.Handler, &out.Handler, s); err != nil {
if err := Convert_core_ProbeHandler_To_v1_ProbeHandler(&in.ProbeHandler, &out.ProbeHandler, s); err != nil {
return err
}
out.InitialDelaySeconds = in.InitialDelaySeconds
@ -6497,6 +6507,30 @@ func Convert_core_Probe_To_v1_Probe(in *core.Probe, out *v1.Probe, s conversion.
return autoConvert_core_Probe_To_v1_Probe(in, out, s)
}
func autoConvert_v1_ProbeHandler_To_core_ProbeHandler(in *v1.ProbeHandler, out *core.ProbeHandler, s conversion.Scope) error {
out.Exec = (*core.ExecAction)(unsafe.Pointer(in.Exec))
out.HTTPGet = (*core.HTTPGetAction)(unsafe.Pointer(in.HTTPGet))
out.TCPSocket = (*core.TCPSocketAction)(unsafe.Pointer(in.TCPSocket))
return nil
}
// Convert_v1_ProbeHandler_To_core_ProbeHandler is an autogenerated conversion function.
func Convert_v1_ProbeHandler_To_core_ProbeHandler(in *v1.ProbeHandler, out *core.ProbeHandler, s conversion.Scope) error {
return autoConvert_v1_ProbeHandler_To_core_ProbeHandler(in, out, s)
}
func autoConvert_core_ProbeHandler_To_v1_ProbeHandler(in *core.ProbeHandler, out *v1.ProbeHandler, s conversion.Scope) error {
out.Exec = (*v1.ExecAction)(unsafe.Pointer(in.Exec))
out.HTTPGet = (*v1.HTTPGetAction)(unsafe.Pointer(in.HTTPGet))
out.TCPSocket = (*v1.TCPSocketAction)(unsafe.Pointer(in.TCPSocket))
return nil
}
// Convert_core_ProbeHandler_To_v1_ProbeHandler is an autogenerated conversion function.
func Convert_core_ProbeHandler_To_v1_ProbeHandler(in *core.ProbeHandler, out *v1.ProbeHandler, s conversion.Scope) error {
return autoConvert_core_ProbeHandler_To_v1_ProbeHandler(in, out, s)
}
func autoConvert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(in *v1.ProjectedVolumeSource, out *core.ProjectedVolumeSource, s conversion.Scope) error {
if in.Sources != nil {
in, out := &in.Sources, &out.Sources

View File

@ -253,20 +253,20 @@ func SetObjectDefaults_Pod(in *v1.Pod) {
SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -303,20 +303,20 @@ func SetObjectDefaults_Pod(in *v1.Pod) {
SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -353,20 +353,20 @@ func SetObjectDefaults_Pod(in *v1.Pod) {
SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -473,20 +473,20 @@ func SetObjectDefaults_PodTemplate(in *v1.PodTemplate) {
SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -523,20 +523,20 @@ func SetObjectDefaults_PodTemplate(in *v1.PodTemplate) {
SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -573,20 +573,20 @@ func SetObjectDefaults_PodTemplate(in *v1.PodTemplate) {
SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -695,20 +695,20 @@ func SetObjectDefaults_ReplicationController(in *v1.ReplicationController) {
SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -745,20 +745,20 @@ func SetObjectDefaults_ReplicationController(in *v1.ReplicationController) {
SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -795,20 +795,20 @@ func SetObjectDefaults_ReplicationController(in *v1.ReplicationController) {
SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -2663,7 +2663,7 @@ func validateProbe(probe *core.Probe, fldPath *field.Path) field.ErrorList {
if probe == nil {
return allErrs
}
allErrs = append(allErrs, validateHandler(&probe.Handler, fldPath)...)
allErrs = append(allErrs, validateHandler(handlerFromProbe(&probe.ProbeHandler), fldPath)...)
allErrs = append(allErrs, ValidateNonnegativeField(int64(probe.InitialDelaySeconds), fldPath.Child("initialDelaySeconds"))...)
allErrs = append(allErrs, ValidateNonnegativeField(int64(probe.TimeoutSeconds), fldPath.Child("timeoutSeconds"))...)
@ -2676,6 +2676,28 @@ func validateProbe(probe *core.Probe, fldPath *field.Path) field.ErrorList {
return allErrs
}
type commonHandler struct {
Exec *core.ExecAction
HTTPGet *core.HTTPGetAction
TCPSocket *core.TCPSocketAction
}
func handlerFromProbe(ph *core.ProbeHandler) commonHandler {
return commonHandler{
Exec: ph.Exec,
HTTPGet: ph.HTTPGet,
TCPSocket: ph.TCPSocket,
}
}
func handlerFromLifecycle(lh *core.LifecycleHandler) commonHandler {
return commonHandler{
Exec: lh.Exec,
HTTPGet: lh.HTTPGet,
TCPSocket: lh.TCPSocket,
}
}
func validateClientIPAffinityConfig(config *core.SessionAffinityConfig, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if config == nil {
@ -2782,7 +2804,7 @@ func validateTCPSocketAction(tcp *core.TCPSocketAction, fldPath *field.Path) fie
return ValidatePortNumOrName(tcp.Port, fldPath.Child("port"))
}
func validateHandler(handler *core.Handler, fldPath *field.Path) field.ErrorList {
func validateHandler(handler commonHandler, fldPath *field.Path) field.ErrorList {
numHandlers := 0
allErrors := field.ErrorList{}
if handler.Exec != nil {
@ -2818,10 +2840,10 @@ func validateHandler(handler *core.Handler, fldPath *field.Path) field.ErrorList
func validateLifecycle(lifecycle *core.Lifecycle, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if lifecycle.PostStart != nil {
allErrs = append(allErrs, validateHandler(lifecycle.PostStart, fldPath.Child("postStart"))...)
allErrs = append(allErrs, validateHandler(handlerFromLifecycle(lifecycle.PostStart), fldPath.Child("postStart"))...)
}
if lifecycle.PreStop != nil {
allErrs = append(allErrs, validateHandler(lifecycle.PreStop, fldPath.Child("preStop"))...)
allErrs = append(allErrs, validateHandler(handlerFromLifecycle(lifecycle.PreStop), fldPath.Child("preStop"))...)
}
return allErrs
}

View File

@ -5930,12 +5930,12 @@ func TestAlphaValidateVolumeDevices(t *testing.T) {
}
func TestValidateProbe(t *testing.T) {
handler := core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}}
handler := core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}}
// These fields must be positive.
positiveFields := [...]string{"InitialDelaySeconds", "TimeoutSeconds", "PeriodSeconds", "SuccessThreshold", "FailureThreshold"}
successCases := []*core.Probe{nil}
for _, field := range positiveFields {
probe := &core.Probe{Handler: handler}
probe := &core.Probe{ProbeHandler: handler}
reflect.ValueOf(probe).Elem().FieldByName(field).SetInt(10)
successCases = append(successCases, probe)
}
@ -5948,7 +5948,7 @@ func TestValidateProbe(t *testing.T) {
errorCases := []*core.Probe{{TimeoutSeconds: 10, InitialDelaySeconds: 10}}
for _, field := range positiveFields {
probe := &core.Probe{Handler: handler}
probe := &core.Probe{ProbeHandler: handler}
reflect.ValueOf(probe).Elem().FieldByName(field).SetInt(-10)
errorCases = append(errorCases, probe)
}
@ -5982,7 +5982,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
},
fldPath: fldPath,
},
@ -5991,7 +5991,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
InitialDelaySeconds: -1,
},
fldPath: fldPath,
@ -6001,7 +6001,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
TimeoutSeconds: -1,
},
fldPath: fldPath,
@ -6011,7 +6011,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
PeriodSeconds: -1,
},
fldPath: fldPath,
@ -6021,7 +6021,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
SuccessThreshold: -1,
},
fldPath: fldPath,
@ -6031,7 +6031,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
FailureThreshold: -1,
},
fldPath: fldPath,
@ -6041,7 +6041,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
TerminationGracePeriodSeconds: utilpointer.Int64(-1),
},
fldPath: fldPath,
@ -6051,7 +6051,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
TerminationGracePeriodSeconds: utilpointer.Int64(0),
},
fldPath: fldPath,
@ -6061,7 +6061,7 @@ func Test_validateProbe(t *testing.T) {
{
args: args{
probe: &core.Probe{
Handler: core.Handler{Exec: &core.ExecAction{Command: []string{"echo"}}},
ProbeHandler: core.ProbeHandler{Exec: &core.ExecAction{Command: []string{"echo"}}},
TerminationGracePeriodSeconds: utilpointer.Int64(1),
},
fldPath: fldPath,
@ -6087,7 +6087,7 @@ func Test_validateProbe(t *testing.T) {
}
func TestValidateHandler(t *testing.T) {
successCases := []core.Handler{
successCases := []core.ProbeHandler{
{Exec: &core.ExecAction{Command: []string{"echo"}}},
{HTTPGet: &core.HTTPGetAction{Path: "/", Port: intstr.FromInt(1), Host: "", Scheme: "HTTP"}},
{HTTPGet: &core.HTTPGetAction{Path: "/foo", Port: intstr.FromInt(65535), Host: "host", Scheme: "HTTP"}},
@ -6096,12 +6096,12 @@ func TestValidateHandler(t *testing.T) {
{HTTPGet: &core.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP", HTTPHeaders: []core.HTTPHeader{{Name: "X-Forwarded-For", Value: "1.2.3.4"}, {Name: "X-Forwarded-For", Value: "5.6.7.8"}}}},
}
for _, h := range successCases {
if errs := validateHandler(&h, field.NewPath("field")); len(errs) != 0 {
if errs := validateHandler(handlerFromProbe(&h), field.NewPath("field")); len(errs) != 0 {
t.Errorf("expected success: %v", errs)
}
}
errorCases := []core.Handler{
errorCases := []core.ProbeHandler{
{},
{Exec: &core.ExecAction{Command: []string{}}},
{HTTPGet: &core.HTTPGetAction{Path: "", Port: intstr.FromInt(0), Host: ""}},
@ -6111,7 +6111,7 @@ func TestValidateHandler(t *testing.T) {
{HTTPGet: &core.HTTPGetAction{Path: "/", Port: intstr.FromString("port"), Host: "", Scheme: "HTTP", HTTPHeaders: []core.HTTPHeader{{Name: "X_Forwarded_For", Value: "foo.example.com"}}}},
}
for _, h := range errorCases {
if errs := validateHandler(&h, field.NewPath("field")); len(errs) == 0 {
if errs := validateHandler(handlerFromProbe(&h), field.NewPath("field")); len(errs) == 0 {
t.Errorf("expected failure for %#v", h)
}
}
@ -6309,7 +6309,7 @@ func TestValidateEphemeralContainers(t *testing.T) {
ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{
PreStop: &core.LifecycleHandler{
Exec: &core.ExecAction{Command: []string{"ls", "-l"}},
},
},
@ -6328,7 +6328,7 @@ func TestValidateEphemeralContainers(t *testing.T) {
ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File",
LivenessProbe: &core.Probe{
Handler: core.Handler{
ProbeHandler: core.ProbeHandler{
TCPSocket: &core.TCPSocketAction{Port: intstr.FromInt(80)},
},
SuccessThreshold: 1,
@ -6365,7 +6365,7 @@ func TestValidateEphemeralContainers(t *testing.T) {
ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File",
ReadinessProbe: &core.Probe{
Handler: core.Handler{
ProbeHandler: core.ProbeHandler{
TCPSocket: &core.TCPSocketAction{Port: intstr.FromInt(80)},
},
},
@ -6584,7 +6584,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{
PreStop: &core.LifecycleHandler{
Exec: &core.ExecAction{Command: []string{"ls", "-l"}},
},
},
@ -6754,7 +6754,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{
PreStop: &core.LifecycleHandler{
Exec: &core.ExecAction{},
},
},
@ -6767,7 +6767,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{
PreStop: &core.LifecycleHandler{
HTTPGet: &core.HTTPGetAction{},
},
},
@ -6780,7 +6780,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{
PreStop: &core.LifecycleHandler{
TCPSocket: &core.TCPSocketAction{},
},
},
@ -6793,7 +6793,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{
PreStop: &core.LifecycleHandler{
TCPSocket: &core.TCPSocketAction{
Port: intstr.FromInt(0),
},
@ -6808,7 +6808,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
Lifecycle: &core.Lifecycle{
PreStop: &core.Handler{},
PreStop: &core.LifecycleHandler{},
},
ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File",
@ -6819,7 +6819,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
ReadinessProbe: &core.Probe{
Handler: core.Handler{
ProbeHandler: core.ProbeHandler{
TCPSocket: &core.TCPSocketAction{},
},
TerminationGracePeriodSeconds: utilpointer.Int64Ptr(10),
@ -6833,7 +6833,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
LivenessProbe: &core.Probe{
Handler: core.Handler{
ProbeHandler: core.ProbeHandler{
TCPSocket: &core.TCPSocketAction{},
},
},
@ -6846,7 +6846,7 @@ func TestValidateContainers(t *testing.T) {
Name: "life-123",
Image: "image",
LivenessProbe: &core.Probe{
Handler: core.Handler{},
ProbeHandler: core.ProbeHandler{},
},
ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File",

View File

@ -1760,37 +1760,6 @@ func (in *HTTPHeader) DeepCopy() *HTTPHeader {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Handler) DeepCopyInto(out *Handler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(ExecAction)
(*in).DeepCopyInto(*out)
}
if in.HTTPGet != nil {
in, out := &in.HTTPGet, &out.HTTPGet
*out = new(HTTPGetAction)
(*in).DeepCopyInto(*out)
}
if in.TCPSocket != nil {
in, out := &in.TCPSocket, &out.TCPSocket
*out = new(TCPSocketAction)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Handler.
func (in *Handler) DeepCopy() *Handler {
if in == nil {
return nil
}
out := new(Handler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HostAlias) DeepCopyInto(out *HostAlias) {
*out = *in
@ -1921,12 +1890,12 @@ func (in *Lifecycle) DeepCopyInto(out *Lifecycle) {
*out = *in
if in.PostStart != nil {
in, out := &in.PostStart, &out.PostStart
*out = new(Handler)
*out = new(LifecycleHandler)
(*in).DeepCopyInto(*out)
}
if in.PreStop != nil {
in, out := &in.PreStop, &out.PreStop
*out = new(Handler)
*out = new(LifecycleHandler)
(*in).DeepCopyInto(*out)
}
return
@ -1942,6 +1911,37 @@ func (in *Lifecycle) DeepCopy() *Lifecycle {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LifecycleHandler) DeepCopyInto(out *LifecycleHandler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(ExecAction)
(*in).DeepCopyInto(*out)
}
if in.HTTPGet != nil {
in, out := &in.HTTPGet, &out.HTTPGet
*out = new(HTTPGetAction)
(*in).DeepCopyInto(*out)
}
if in.TCPSocket != nil {
in, out := &in.TCPSocket, &out.TCPSocket
*out = new(TCPSocketAction)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LifecycleHandler.
func (in *LifecycleHandler) DeepCopy() *LifecycleHandler {
if in == nil {
return nil
}
out := new(LifecycleHandler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LimitRange) DeepCopyInto(out *LimitRange) {
*out = *in
@ -4185,7 +4185,7 @@ func (in *PreferredSchedulingTerm) DeepCopy() *PreferredSchedulingTerm {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Probe) DeepCopyInto(out *Probe) {
*out = *in
in.Handler.DeepCopyInto(&out.Handler)
in.ProbeHandler.DeepCopyInto(&out.ProbeHandler)
if in.TerminationGracePeriodSeconds != nil {
in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds
*out = new(int64)
@ -4204,6 +4204,37 @@ func (in *Probe) DeepCopy() *Probe {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProbeHandler) DeepCopyInto(out *ProbeHandler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(ExecAction)
(*in).DeepCopyInto(*out)
}
if in.HTTPGet != nil {
in, out := &in.HTTPGet, &out.HTTPGet
*out = new(HTTPGetAction)
(*in).DeepCopyInto(*out)
}
if in.TCPSocket != nil {
in, out := &in.TCPSocket, &out.TCPSocket
*out = new(TCPSocketAction)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeHandler.
func (in *ProbeHandler) DeepCopy() *ProbeHandler {
if in == nil {
return nil
}
out := new(ProbeHandler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProjectedVolumeSource) DeepCopyInto(out *ProjectedVolumeSource) {
*out = *in

View File

@ -128,20 +128,20 @@ func SetObjectDefaults_DaemonSet(in *v1beta1.DaemonSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -178,20 +178,20 @@ func SetObjectDefaults_DaemonSet(in *v1beta1.DaemonSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -228,20 +228,20 @@ func SetObjectDefaults_DaemonSet(in *v1beta1.DaemonSet) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -349,20 +349,20 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -399,20 +399,20 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -449,20 +449,20 @@ func SetObjectDefaults_Deployment(in *v1beta1.Deployment) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {
@ -611,20 +611,20 @@ func SetObjectDefaults_ReplicaSet(in *v1beta1.ReplicaSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -661,20 +661,20 @@ func SetObjectDefaults_ReplicaSet(in *v1beta1.ReplicaSet) {
v1.SetDefaults_ResourceList(&a.Resources.Requests)
if a.LivenessProbe != nil {
v1.SetDefaults_Probe(a.LivenessProbe)
if a.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.Handler.HTTPGet)
if a.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.ReadinessProbe)
if a.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.Handler.HTTPGet)
if a.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.StartupProbe != nil {
v1.SetDefaults_Probe(a.StartupProbe)
if a.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.Handler.HTTPGet)
if a.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.Lifecycle != nil {
@ -711,20 +711,20 @@ func SetObjectDefaults_ReplicaSet(in *v1beta1.ReplicaSet) {
v1.SetDefaults_ResourceList(&a.EphemeralContainerCommon.Resources.Requests)
if a.EphemeralContainerCommon.LivenessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.LivenessProbe)
if a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.ReadinessProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.ReadinessProbe)
if a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.StartupProbe != nil {
v1.SetDefaults_Probe(a.EphemeralContainerCommon.StartupProbe)
if a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.Handler.HTTPGet)
if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet != nil {
v1.SetDefaults_HTTPGetAction(a.EphemeralContainerCommon.StartupProbe.ProbeHandler.HTTPGet)
}
}
if a.EphemeralContainerCommon.Lifecycle != nil {

View File

@ -39,7 +39,7 @@ import (
// HandlerRunner runs a lifecycle handler for a container.
type HandlerRunner interface {
Run(containerID ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.Handler) (string, error)
Run(containerID ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.LifecycleHandler) (string, error)
}
// RuntimeHelper wraps kubelet to make container runtime

View File

@ -255,7 +255,7 @@ func TestLifeCycleHook(t *testing.T) {
},
}
cmdPostStart := &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"PostStartCMD"},
},
@ -263,7 +263,7 @@ func TestLifeCycleHook(t *testing.T) {
}
httpLifeCycle := &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "testHost.com",
Path: "/GracefulExit",
@ -272,7 +272,7 @@ func TestLifeCycleHook(t *testing.T) {
}
cmdLifeCycle := &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"PreStopCMD"},
},

View File

@ -67,7 +67,7 @@ type annotatedContainerInfo struct {
PodTerminationGracePeriod *int64
TerminationMessagePath string
TerminationMessagePolicy v1.TerminationMessagePolicy
PreStopHandler *v1.Handler
PreStopHandler *v1.LifecycleHandler
ContainerPorts []v1.ContainerPort
}
@ -203,7 +203,7 @@ func getContainerInfoFromAnnotations(annotations map[string]string) *annotatedCo
klog.ErrorS(err, "Unable to get label value from annotations", "label", podTerminationGracePeriodLabel, "annotations", annotations)
}
preStopHandler := &v1.Handler{}
preStopHandler := &v1.LifecycleHandler{}
if found, err := getJSONObjectFromLabel(annotations, containerPreStopHandlerLabel, preStopHandler); err != nil {
klog.ErrorS(err, "Unable to get label value from annotations", "label", containerPreStopHandlerLabel, "annotations", annotations)
} else if found {

View File

@ -20,7 +20,7 @@ import (
"reflect"
"testing"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
@ -31,7 +31,7 @@ func TestContainerLabels(t *testing.T) {
terminationGracePeriod := int64(10)
lifecycle := &v1.Lifecycle{
// Left PostStart as nil
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"action1", "action2"},
},
@ -100,7 +100,7 @@ func TestContainerAnnotations(t *testing.T) {
}
lifecycle := &v1.Lifecycle{
// Left PostStart as nil
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"action1", "action2"},
},

View File

@ -22,7 +22,7 @@ import (
"net/http"
"strconv"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/klog/v2"
@ -56,7 +56,7 @@ func NewHandlerRunner(httpGetter kubetypes.HTTPGetter, commandRunner kubecontain
}
}
func (hr *handlerRunner) Run(containerID kubecontainer.ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.Handler) (string, error) {
func (hr *handlerRunner) Run(containerID kubecontainer.ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.LifecycleHandler) (string, error) {
switch {
case handler.Exec != nil:
var msg string
@ -105,7 +105,7 @@ func resolvePort(portReference intstr.IntOrString, container *v1.Container) (int
return -1, fmt.Errorf("couldn't find port: %v in %v", portReference, container)
}
func (hr *handlerRunner) runHTTPHandler(pod *v1.Pod, container *v1.Container, handler *v1.Handler) (string, error) {
func (hr *handlerRunner) runHTTPHandler(pod *v1.Pod, container *v1.Container, handler *v1.LifecycleHandler) (string, error) {
host := handler.HTTPGet.Host
if len(host) == 0 {
status, err := hr.containerManager.GetPodStatus(pod.UID, pod.Name, pod.Namespace)

View File

@ -25,7 +25,7 @@ import (
"testing"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/util/format"
@ -99,7 +99,7 @@ func TestRunHandlerExec(t *testing.T) {
container := v1.Container{
Name: containerName,
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"ls", "-a"},
},
@ -142,7 +142,7 @@ func TestRunHandlerHttp(t *testing.T) {
container := v1.Container{
Name: containerName,
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "foo",
Port: intstr.FromInt(8080),
@ -175,7 +175,7 @@ func TestRunHandlerNil(t *testing.T) {
container := v1.Container{
Name: containerName,
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{},
PostStart: &v1.LifecycleHandler{},
},
}
pod := v1.Pod{}
@ -200,7 +200,7 @@ func TestRunHandlerExecFailure(t *testing.T) {
container := v1.Container{
Name: containerName,
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: command,
},
@ -234,7 +234,7 @@ func TestRunHandlerHttpFailure(t *testing.T) {
container := v1.Container{
Name: containerName,
Lifecycle: &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Host: "foo",
Port: intstr.FromInt(8080),

View File

@ -75,7 +75,7 @@ func getTestPod() *v1.Pod {
func setTestProbe(pod *v1.Pod, probeType probeType, probeSpec v1.Probe) {
// All tests rely on the fake exec prober.
probeSpec.Handler = v1.Handler{
probeSpec.ProbeHandler = v1.ProbeHandler{
Exec: &v1.ExecAction{},
}

View File

@ -38,7 +38,7 @@ func init() {
}
var defaultProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{},
},
TimeoutSeconds: 1,

View File

@ -100,7 +100,7 @@ func TestGetURLParts(t *testing.T) {
container := v1.Container{
Ports: []v1.ContainerPort{{Name: "found", ContainerPort: 93}},
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: test.probe,
},
},
@ -153,7 +153,7 @@ func TestGetTCPAddrParts(t *testing.T) {
container := v1.Container{
Ports: []v1.ContainerPort{{Name: "found", ContainerPort: 93}},
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
TCPSocket: test.probe,
},
},
@ -204,7 +204,7 @@ func TestProbe(t *testing.T) {
containerID := kubecontainer.ContainerID{Type: "test", ID: "foobar"}
execProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{},
},
}
@ -255,7 +255,7 @@ func TestProbe(t *testing.T) {
},
{ // Probe arguments are passed through
probe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/bash", "-c", "some script"},
},
@ -267,7 +267,7 @@ func TestProbe(t *testing.T) {
},
{ // Probe arguments are passed through
probe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/bash", "-c", "some $(A) $(B)"},
},

File diff suppressed because it is too large Load Diff

View File

@ -1746,25 +1746,6 @@ message HTTPHeader {
optional string value = 2;
}
// Handler defines a specific action that should be taken
// TODO: pass structured data to these actions, and document that data here.
message Handler {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
optional ExecAction exec = 1;
// HTTPGet specifies the http request to perform.
// +optional
optional HTTPGetAction httpGet = 2;
// TCPSocket specifies an action involving a TCP port.
// TCP hooks not yet supported
// TODO: implement a realistic TCP lifecycle hook
// +optional
optional TCPSocketAction tcpSocket = 3;
}
// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
// pod's hosts file.
message HostAlias {
@ -1932,7 +1913,7 @@ message Lifecycle {
// Other management of the container blocks until the hook completes.
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional
optional Handler postStart = 1;
optional LifecycleHandler postStart = 1;
// PreStop is called immediately before a container is terminated due to an
// API request or management event such as liveness/startup probe failure,
@ -1945,7 +1926,28 @@ message Lifecycle {
// or until the termination grace period is reached.
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional
optional Handler preStop = 2;
optional LifecycleHandler preStop = 2;
}
// LifecycleHandler defines a specific action that should be taken in a lifecycle
// hook. This type has a strong relationship to ProbeHandler - overlapping fields
// should be identical.
// TODO: pass structured data to these actions, and document that data here.
message LifecycleHandler {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
optional ExecAction exec = 1;
// HTTPGet specifies the http request to perform.
// +optional
optional HTTPGetAction httpGet = 2;
// TCPSocket specifies an action involving a TCP port.
// TCP hooks not yet supported
// TODO: implement a realistic TCP lifecycle hook
// +optional
optional TCPSocketAction tcpSocket = 3;
}
// LimitRange sets resource usage limits for each kind of resource in a Namespace.
@ -3928,7 +3930,7 @@ message PreferredSchedulingTerm {
// alive or ready to receive traffic.
message Probe {
// The action taken to determine the health of a container
optional Handler handler = 1;
optional ProbeHandler handler = 1;
// Number of seconds after the container has started before liveness probes are initiated.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
@ -3970,6 +3972,27 @@ message Probe {
optional int64 terminationGracePeriodSeconds = 7;
}
// ProbeHandler defines a specific action that should be taken in a probe.
// This type has a strong relationship to LifecycleHandler - overlapping fields
// should be identical.
// TODO: pass structured data to these actions, and document that data here.
message ProbeHandler {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
optional ExecAction exec = 1;
// HTTPGet specifies the http request to perform.
// +optional
optional HTTPGetAction httpGet = 2;
// TCPSocket specifies an action involving a TCP port.
// TCP hooks not yet supported
// TODO: implement a realistic TCP lifecycle hook
// +optional
optional TCPSocketAction tcpSocket = 3;
}
// Represents a projected volume source
message ProjectedVolumeSource {
// list of volume projections

View File

@ -2117,7 +2117,7 @@ type ExecAction struct {
// alive or ready to receive traffic.
type Probe struct {
// The action taken to determine the health of a container
Handler `json:",inline" protobuf:"bytes,1,opt,name=handler"`
ProbeHandler `json:",inline" protobuf:"bytes,1,opt,name=handler"`
// Number of seconds after the container has started before liveness probes are initiated.
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
// +optional
@ -2381,9 +2381,30 @@ type Container struct {
TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"`
}
// Handler defines a specific action that should be taken
// ProbeHandler defines a specific action that should be taken in a probe.
// This type has a strong relationship to LifecycleHandler - overlapping fields
// should be identical.
// TODO: pass structured data to these actions, and document that data here.
type Handler struct {
type ProbeHandler struct {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
Exec *ExecAction `json:"exec,omitempty" protobuf:"bytes,1,opt,name=exec"`
// HTTPGet specifies the http request to perform.
// +optional
HTTPGet *HTTPGetAction `json:"httpGet,omitempty" protobuf:"bytes,2,opt,name=httpGet"`
// TCPSocket specifies an action involving a TCP port.
// TCP hooks not yet supported
// TODO: implement a realistic TCP lifecycle hook
// +optional
TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"`
}
// LifecycleHandler defines a specific action that should be taken in a lifecycle
// hook. This type has a strong relationship to ProbeHandler - overlapping fields
// should be identical.
// TODO: pass structured data to these actions, and document that data here.
type LifecycleHandler struct {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
@ -2407,7 +2428,7 @@ type Lifecycle struct {
// Other management of the container blocks until the hook completes.
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional
PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"`
PostStart *LifecycleHandler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"`
// PreStop is called immediately before a container is terminated due to an
// API request or management event such as liveness/startup probe failure,
// preemption, resource contention, etc. The handler is not called if the
@ -2419,7 +2440,7 @@ type Lifecycle struct {
// or until the termination grace period is reached.
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
// +optional
PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"`
PreStop *LifecycleHandler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"`
}
type ConditionStatus string

View File

@ -806,17 +806,6 @@ func (HTTPHeader) SwaggerDoc() map[string]string {
return map_HTTPHeader
}
var map_Handler = map[string]string{
"": "Handler defines a specific action that should be taken",
"exec": "One and only one of the following should be specified. Exec specifies the action to take.",
"httpGet": "HTTPGet specifies the http request to perform.",
"tcpSocket": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported",
}
func (Handler) SwaggerDoc() map[string]string {
return map_Handler
}
var map_HostAlias = map[string]string{
"": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.",
"ip": "IP address of the host file entry.",
@ -896,6 +885,17 @@ func (Lifecycle) SwaggerDoc() map[string]string {
return map_Lifecycle
}
var map_LifecycleHandler = map[string]string{
"": "LifecycleHandler defines a specific action that should be taken in a lifecycle hook. This type has a strong relationship to ProbeHandler - overlapping fields should be identical.",
"exec": "One and only one of the following should be specified. Exec specifies the action to take.",
"httpGet": "HTTPGet specifies the http request to perform.",
"tcpSocket": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported",
}
func (LifecycleHandler) SwaggerDoc() map[string]string {
return map_LifecycleHandler
}
var map_LimitRange = map[string]string{
"": "LimitRange sets resource usage limits for each kind of resource in a Namespace.",
"metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@ -1792,6 +1792,17 @@ func (Probe) SwaggerDoc() map[string]string {
return map_Probe
}
var map_ProbeHandler = map[string]string{
"": "ProbeHandler defines a specific action that should be taken in a probe. This type has a strong relationship to LifecycleHandler - overlapping fields should be identical.",
"exec": "One and only one of the following should be specified. Exec specifies the action to take.",
"httpGet": "HTTPGet specifies the http request to perform.",
"tcpSocket": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported",
}
func (ProbeHandler) SwaggerDoc() map[string]string {
return map_ProbeHandler
}
var map_ProjectedVolumeSource = map[string]string{
"": "Represents a projected volume source",
"sources": "list of volume projections",

View File

@ -1760,37 +1760,6 @@ func (in *HTTPHeader) DeepCopy() *HTTPHeader {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Handler) DeepCopyInto(out *Handler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(ExecAction)
(*in).DeepCopyInto(*out)
}
if in.HTTPGet != nil {
in, out := &in.HTTPGet, &out.HTTPGet
*out = new(HTTPGetAction)
(*in).DeepCopyInto(*out)
}
if in.TCPSocket != nil {
in, out := &in.TCPSocket, &out.TCPSocket
*out = new(TCPSocketAction)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Handler.
func (in *Handler) DeepCopy() *Handler {
if in == nil {
return nil
}
out := new(Handler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HostAlias) DeepCopyInto(out *HostAlias) {
*out = *in
@ -1921,12 +1890,12 @@ func (in *Lifecycle) DeepCopyInto(out *Lifecycle) {
*out = *in
if in.PostStart != nil {
in, out := &in.PostStart, &out.PostStart
*out = new(Handler)
*out = new(LifecycleHandler)
(*in).DeepCopyInto(*out)
}
if in.PreStop != nil {
in, out := &in.PreStop, &out.PreStop
*out = new(Handler)
*out = new(LifecycleHandler)
(*in).DeepCopyInto(*out)
}
return
@ -1942,6 +1911,37 @@ func (in *Lifecycle) DeepCopy() *Lifecycle {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LifecycleHandler) DeepCopyInto(out *LifecycleHandler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(ExecAction)
(*in).DeepCopyInto(*out)
}
if in.HTTPGet != nil {
in, out := &in.HTTPGet, &out.HTTPGet
*out = new(HTTPGetAction)
(*in).DeepCopyInto(*out)
}
if in.TCPSocket != nil {
in, out := &in.TCPSocket, &out.TCPSocket
*out = new(TCPSocketAction)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LifecycleHandler.
func (in *LifecycleHandler) DeepCopy() *LifecycleHandler {
if in == nil {
return nil
}
out := new(LifecycleHandler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LimitRange) DeepCopyInto(out *LimitRange) {
*out = *in
@ -4183,7 +4183,7 @@ func (in *PreferredSchedulingTerm) DeepCopy() *PreferredSchedulingTerm {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Probe) DeepCopyInto(out *Probe) {
*out = *in
in.Handler.DeepCopyInto(&out.Handler)
in.ProbeHandler.DeepCopyInto(&out.ProbeHandler)
if in.TerminationGracePeriodSeconds != nil {
in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds
*out = new(int64)
@ -4202,6 +4202,37 @@ func (in *Probe) DeepCopy() *Probe {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProbeHandler) DeepCopyInto(out *ProbeHandler) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
*out = new(ExecAction)
(*in).DeepCopyInto(*out)
}
if in.HTTPGet != nil {
in, out := &in.HTTPGet, &out.HTTPGet
*out = new(HTTPGetAction)
(*in).DeepCopyInto(*out)
}
if in.TCPSocket != nil {
in, out := &in.TCPSocket, &out.TCPSocket
*out = new(TCPSocketAction)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProbeHandler.
func (in *ProbeHandler) DeepCopy() *ProbeHandler {
if in == nil {
return nil
}
out := new(ProbeHandler)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProjectedVolumeSource) DeepCopyInto(out *ProjectedVolumeSource) {
*out = *in

View File

@ -21,8 +21,8 @@ package v1
// LifecycleApplyConfiguration represents an declarative configuration of the Lifecycle type for use
// with apply.
type LifecycleApplyConfiguration struct {
PostStart *HandlerApplyConfiguration `json:"postStart,omitempty"`
PreStop *HandlerApplyConfiguration `json:"preStop,omitempty"`
PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"`
PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"`
}
// LifecycleApplyConfiguration constructs an declarative configuration of the Lifecycle type for use with
@ -34,7 +34,7 @@ func Lifecycle() *LifecycleApplyConfiguration {
// WithPostStart sets the PostStart field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PostStart field is set to the value of the last call.
func (b *LifecycleApplyConfiguration) WithPostStart(value *HandlerApplyConfiguration) *LifecycleApplyConfiguration {
func (b *LifecycleApplyConfiguration) WithPostStart(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration {
b.PostStart = value
return b
}
@ -42,7 +42,7 @@ func (b *LifecycleApplyConfiguration) WithPostStart(value *HandlerApplyConfigura
// WithPreStop sets the PreStop field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PreStop field is set to the value of the last call.
func (b *LifecycleApplyConfiguration) WithPreStop(value *HandlerApplyConfiguration) *LifecycleApplyConfiguration {
func (b *LifecycleApplyConfiguration) WithPreStop(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration {
b.PreStop = value
return b
}

View File

@ -0,0 +1,57 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// LifecycleHandlerApplyConfiguration represents an declarative configuration of the LifecycleHandler type for use
// with apply.
type LifecycleHandlerApplyConfiguration struct {
Exec *ExecActionApplyConfiguration `json:"exec,omitempty"`
HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"`
TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"`
}
// LifecycleHandlerApplyConfiguration constructs an declarative configuration of the LifecycleHandler type for use with
// apply.
func LifecycleHandler() *LifecycleHandlerApplyConfiguration {
return &LifecycleHandlerApplyConfiguration{}
}
// WithExec sets the Exec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Exec field is set to the value of the last call.
func (b *LifecycleHandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *LifecycleHandlerApplyConfiguration {
b.Exec = value
return b
}
// WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HTTPGet field is set to the value of the last call.
func (b *LifecycleHandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *LifecycleHandlerApplyConfiguration {
b.HTTPGet = value
return b
}
// WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TCPSocket field is set to the value of the last call.
func (b *LifecycleHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *LifecycleHandlerApplyConfiguration {
b.TCPSocket = value
return b
}

View File

@ -21,13 +21,13 @@ package v1
// ProbeApplyConfiguration represents an declarative configuration of the Probe type for use
// with apply.
type ProbeApplyConfiguration struct {
HandlerApplyConfiguration `json:",inline"`
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
ProbeHandlerApplyConfiguration `json:",inline"`
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}
// ProbeApplyConfiguration constructs an declarative configuration of the Probe type for use with

View File

@ -18,24 +18,24 @@ limitations under the License.
package v1
// HandlerApplyConfiguration represents an declarative configuration of the Handler type for use
// ProbeHandlerApplyConfiguration represents an declarative configuration of the ProbeHandler type for use
// with apply.
type HandlerApplyConfiguration struct {
type ProbeHandlerApplyConfiguration struct {
Exec *ExecActionApplyConfiguration `json:"exec,omitempty"`
HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"`
TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"`
}
// HandlerApplyConfiguration constructs an declarative configuration of the Handler type for use with
// ProbeHandlerApplyConfiguration constructs an declarative configuration of the ProbeHandler type for use with
// apply.
func Handler() *HandlerApplyConfiguration {
return &HandlerApplyConfiguration{}
func ProbeHandler() *ProbeHandlerApplyConfiguration {
return &ProbeHandlerApplyConfiguration{}
}
// WithExec sets the Exec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Exec field is set to the value of the last call.
func (b *HandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *HandlerApplyConfiguration {
func (b *ProbeHandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *ProbeHandlerApplyConfiguration {
b.Exec = value
return b
}
@ -43,7 +43,7 @@ func (b *HandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration
// WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HTTPGet field is set to the value of the last call.
func (b *HandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *HandlerApplyConfiguration {
func (b *ProbeHandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *ProbeHandlerApplyConfiguration {
b.HTTPGet = value
return b
}
@ -51,7 +51,7 @@ func (b *HandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfigu
// WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TCPSocket field is set to the value of the last call.
func (b *HandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *HandlerApplyConfiguration {
func (b *ProbeHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *ProbeHandlerApplyConfiguration {
b.TCPSocket = value
return b
}

View File

@ -4199,18 +4199,6 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.core.v1.Handler
map:
fields:
- name: exec
type:
namedType: io.k8s.api.core.v1.ExecAction
- name: httpGet
type:
namedType: io.k8s.api.core.v1.HTTPGetAction
- name: tcpSocket
type:
namedType: io.k8s.api.core.v1.TCPSocketAction
- name: io.k8s.api.core.v1.HostAlias
map:
fields:
@ -4336,10 +4324,22 @@ var schemaYAML = typed.YAMLObject(`types:
fields:
- name: postStart
type:
namedType: io.k8s.api.core.v1.Handler
namedType: io.k8s.api.core.v1.LifecycleHandler
- name: preStop
type:
namedType: io.k8s.api.core.v1.Handler
namedType: io.k8s.api.core.v1.LifecycleHandler
- name: io.k8s.api.core.v1.LifecycleHandler
map:
fields:
- name: exec
type:
namedType: io.k8s.api.core.v1.ExecAction
- name: httpGet
type:
namedType: io.k8s.api.core.v1.HTTPGetAction
- name: tcpSocket
type:
namedType: io.k8s.api.core.v1.TCPSocketAction
- name: io.k8s.api.core.v1.LimitRange
map:
fields:

View File

@ -551,8 +551,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.GlusterfsPersistentVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("GlusterfsVolumeSource"):
return &applyconfigurationscorev1.GlusterfsVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("Handler"):
return &applyconfigurationscorev1.HandlerApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("HostAlias"):
return &applyconfigurationscorev1.HostAliasApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("HostPathVolumeSource"):
@ -569,6 +567,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.KeyToPathApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("Lifecycle"):
return &applyconfigurationscorev1.LifecycleApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LifecycleHandler"):
return &applyconfigurationscorev1.LifecycleHandlerApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LimitRange"):
return &applyconfigurationscorev1.LimitRangeApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LimitRangeItem"):
@ -683,6 +683,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.PreferredSchedulingTermApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("Probe"):
return &applyconfigurationscorev1.ProbeApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ProbeHandler"):
return &applyconfigurationscorev1.ProbeHandlerApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ProjectedVolumeSource"):
return &applyconfigurationscorev1.ProjectedVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("QuobyteVolumeSource"):

View File

@ -296,7 +296,7 @@ func deployCustomResourceWebhookAndService(f *framework.Framework, image string,
fmt.Sprintf("--port=%d", containerPort),
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Scheme: v1.URISchemeHTTPS,
Port: intstr.FromInt(int(containerPort)),

View File

@ -22,7 +22,7 @@ import (
"time"
batchv1 "k8s.io/api/batch/v1"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
@ -52,7 +52,7 @@ func testingPod(name, value string) v1.Pod {
Image: imageutils.GetE2EImage(imageutils.Nginx),
Ports: []v1.ContainerPort{{ContainerPort: 80}},
LivenessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/index.html",
Port: intstr.FromInt(8080),

View File

@ -797,7 +797,7 @@ func deployWebhookAndService(f *framework.Framework, image string, certCtx *cert
fmt.Sprintf("--port=%d", containerPort),
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Scheme: v1.URISchemeHTTPS,
Port: intstr.FromInt(int(containerPort)),

View File

@ -513,7 +513,7 @@ var _ = SIGDescribe("Daemon set [Serial]", func() {
}
// delay shutdown by 15s to allow containers to overlap in time
ds.Spec.Template.Spec.Containers[0].Lifecycle = &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/sh", "-c", "sleep 15"},
},
@ -521,7 +521,7 @@ var _ = SIGDescribe("Daemon set [Serial]", func() {
}
// use a readiness probe that can be forced to fail (by changing the contents of /var/tmp/ready)
ds.Spec.Template.Spec.Containers[0].ReadinessProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/sh", "-ec", `touch /var/tmp/ready; [[ "$( cat /var/tmp/ready )" == "" ]]`},
},

View File

@ -71,7 +71,7 @@ const (
)
var httpProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/index.html",
Port: intstr.IntOrString{IntVal: 80},

View File

@ -123,7 +123,7 @@ var _ = SIGDescribe("Probing container", func() {
framework.ConformanceIt("should be restarted with a exec \"cat /tmp/health\" liveness probe [NodeConformance]", func() {
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 10; rm -rf /tmp/health; sleep 600"}
livenessProbe := &v1.Probe{
Handler: execHandler([]string{"cat", "/tmp/health"}),
ProbeHandler: execHandler([]string{"cat", "/tmp/health"}),
InitialDelaySeconds: 15,
TimeoutSeconds: 5, // default 1s can be pretty aggressive in CI environments with low resources
FailureThreshold: 1,
@ -140,7 +140,7 @@ var _ = SIGDescribe("Probing container", func() {
framework.ConformanceIt("should *not* be restarted with a exec \"cat /tmp/health\" liveness probe [NodeConformance]", func() {
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 600"}
livenessProbe := &v1.Probe{
Handler: execHandler([]string{"cat", "/tmp/health"}),
ProbeHandler: execHandler([]string{"cat", "/tmp/health"}),
InitialDelaySeconds: 15,
TimeoutSeconds: 5, // default 1s can be pretty aggressive in CI environments with low resources
FailureThreshold: 1,
@ -156,7 +156,7 @@ var _ = SIGDescribe("Probing container", func() {
*/
framework.ConformanceIt("should be restarted with a /healthz http liveness probe [NodeConformance]", func() {
livenessProbe := &v1.Probe{
Handler: httpGetHandler("/healthz", 8080),
ProbeHandler: httpGetHandler("/healthz", 8080),
InitialDelaySeconds: 15,
FailureThreshold: 1,
}
@ -171,7 +171,7 @@ var _ = SIGDescribe("Probing container", func() {
*/
framework.ConformanceIt("should *not* be restarted with a tcp:8080 liveness probe [NodeConformance]", func() {
livenessProbe := &v1.Probe{
Handler: tcpSocketHandler(8080),
ProbeHandler: tcpSocketHandler(8080),
InitialDelaySeconds: 15,
FailureThreshold: 1,
}
@ -186,7 +186,7 @@ var _ = SIGDescribe("Probing container", func() {
*/
framework.ConformanceIt("should have monotonically increasing restart count [NodeConformance]", func() {
livenessProbe := &v1.Probe{
Handler: httpGetHandler("/healthz", 8080),
ProbeHandler: httpGetHandler("/healthz", 8080),
InitialDelaySeconds: 5,
FailureThreshold: 1,
}
@ -201,7 +201,7 @@ var _ = SIGDescribe("Probing container", func() {
*/
framework.ConformanceIt("should *not* be restarted with a /healthz http liveness probe [NodeConformance]", func() {
livenessProbe := &v1.Probe{
Handler: httpGetHandler("/", 80),
ProbeHandler: httpGetHandler("/", 80),
InitialDelaySeconds: 15,
TimeoutSeconds: 5,
FailureThreshold: 5, // to accommodate nodes which are slow in bringing up containers.
@ -221,7 +221,7 @@ var _ = SIGDescribe("Probing container", func() {
e2eskipper.SkipUnlessFeatureGateEnabled(kubefeatures.ExecProbeTimeout)
cmd := []string{"/bin/sh", "-c", "sleep 600"}
livenessProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
InitialDelaySeconds: 15,
TimeoutSeconds: 1,
FailureThreshold: 1,
@ -242,7 +242,7 @@ var _ = SIGDescribe("Probing container", func() {
cmd := []string{"/bin/sh", "-c", "sleep 600"}
readinessProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10"}),
InitialDelaySeconds: 15,
TimeoutSeconds: 1,
FailureThreshold: 1,
@ -264,7 +264,7 @@ var _ = SIGDescribe("Probing container", func() {
cmd := []string{"/bin/sh", "-c", "sleep 600"}
livenessProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/sh", "-c", "sleep 10 & exit 1"}),
ProbeHandler: execHandler([]string{"/bin/sh", "-c", "sleep 10 & exit 1"}),
InitialDelaySeconds: 15,
TimeoutSeconds: 1,
FailureThreshold: 1,
@ -280,7 +280,7 @@ var _ = SIGDescribe("Probing container", func() {
*/
ginkgo.It("should be restarted with a local redirect http liveness probe", func() {
livenessProbe := &v1.Probe{
Handler: httpGetHandler("/redirect?loc="+url.QueryEscape("/healthz"), 8080),
ProbeHandler: httpGetHandler("/redirect?loc="+url.QueryEscape("/healthz"), 8080),
InitialDelaySeconds: 15,
FailureThreshold: 1,
}
@ -295,7 +295,7 @@ var _ = SIGDescribe("Probing container", func() {
*/
ginkgo.It("should *not* be restarted with a non-local redirect http liveness probe", func() {
livenessProbe := &v1.Probe{
Handler: httpGetHandler("/redirect?loc="+url.QueryEscape("http://0.0.0.0/"), 8080),
ProbeHandler: httpGetHandler("/redirect?loc="+url.QueryEscape("http://0.0.0.0/"), 8080),
InitialDelaySeconds: 15,
FailureThreshold: 1,
}
@ -320,7 +320,7 @@ var _ = SIGDescribe("Probing container", func() {
ginkgo.It("should be restarted startup probe fails", func() {
cmd := []string{"/bin/sh", "-c", "sleep 600"}
livenessProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/true"},
},
@ -329,7 +329,7 @@ var _ = SIGDescribe("Probing container", func() {
FailureThreshold: 1,
}
startupProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/false"},
},
@ -349,7 +349,7 @@ var _ = SIGDescribe("Probing container", func() {
ginkgo.It("should *not* be restarted by liveness probe because startup probe delays it", func() {
cmd := []string{"/bin/sh", "-c", "sleep 600"}
livenessProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/false"},
},
@ -358,7 +358,7 @@ var _ = SIGDescribe("Probing container", func() {
FailureThreshold: 1,
}
startupProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/false"},
},
@ -378,7 +378,7 @@ var _ = SIGDescribe("Probing container", func() {
ginkgo.It("should be restarted by liveness probe after startup probe enables it", func() {
cmd := []string{"/bin/sh", "-c", "sleep 10; echo ok >/tmp/startup; sleep 600"}
livenessProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/false"},
},
@ -387,7 +387,7 @@ var _ = SIGDescribe("Probing container", func() {
FailureThreshold: 1,
}
startupProbe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"cat", "/tmp/startup"},
},
@ -410,12 +410,12 @@ var _ = SIGDescribe("Probing container", func() {
// to avoid flakes, ensure sleep before startup (32s) > readinessProbe.PeriodSeconds
cmd := []string{"/bin/sh", "-c", "echo ok >/tmp/health; sleep 32; echo ok >/tmp/startup; sleep 600"}
readinessProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/cat", "/tmp/health"}),
ProbeHandler: execHandler([]string{"/bin/cat", "/tmp/health"}),
InitialDelaySeconds: 0,
PeriodSeconds: 30,
}
startupProbe := &v1.Probe{
Handler: execHandler([]string{"/bin/cat", "/tmp/startup"}),
ProbeHandler: execHandler([]string{"/bin/cat", "/tmp/startup"}),
InitialDelaySeconds: 0,
FailureThreshold: 120,
PeriodSeconds: 5,
@ -465,7 +465,7 @@ var _ = SIGDescribe("Probing container", func() {
// probe will fail since pod has no http endpoints
shortGracePeriod := int64(5)
pod.Spec.Containers[0].LivenessProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/healthz",
Port: intstr.FromInt(8080),
@ -493,14 +493,14 @@ var _ = SIGDescribe("Probing container", func() {
// startup probe will fail since pod will sleep for 1000s before becoming ready
shortGracePeriod := int64(5)
pod.Spec.Containers[0].StartupProbe = &v1.Probe{
Handler: execHandler([]string{"/bin/cat", "/tmp/startup"}),
ProbeHandler: execHandler([]string{"/bin/cat", "/tmp/startup"}),
InitialDelaySeconds: 10,
FailureThreshold: 1,
TerminationGracePeriodSeconds: &shortGracePeriod,
}
// liveness probe always succeeds
pod.Spec.Containers[0].LivenessProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/true"},
},
@ -613,16 +613,16 @@ func startupPodSpec(startupProbe, readinessProbe, livenessProbe *v1.Probe, cmd [
}
}
func execHandler(cmd []string) v1.Handler {
return v1.Handler{
func execHandler(cmd []string) v1.ProbeHandler {
return v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: cmd,
},
}
}
func httpGetHandler(path string, port int) v1.Handler {
return v1.Handler{
func httpGetHandler(path string, port int) v1.ProbeHandler {
return v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: path,
Port: intstr.FromInt(port),
@ -630,8 +630,8 @@ func httpGetHandler(path string, port int) v1.Handler {
}
}
func tcpSocketHandler(port int) v1.Handler {
return v1.Handler{
func tcpSocketHandler(port int) v1.ProbeHandler {
return v1.ProbeHandler{
TCPSocket: &v1.TCPSocketAction{
Port: intstr.FromInt(port),
},
@ -655,7 +655,7 @@ func (b webserverProbeBuilder) withInitialDelay() webserverProbeBuilder {
func (b webserverProbeBuilder) build() *v1.Probe {
probe := &v1.Probe{
Handler: httpGetHandler("/", 80),
ProbeHandler: httpGetHandler("/", 80),
}
if b.initialDelay {
probe.InitialDelaySeconds = probeTestInitialDelaySeconds

View File

@ -94,7 +94,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
*/
framework.ConformanceIt("should execute poststart exec hook properly [NodeConformance]", func() {
lifecycle := &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"sh", "-c", "curl http://" + targetURL + ":8080/echo?msg=poststart"},
},
@ -111,7 +111,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
*/
framework.ConformanceIt("should execute prestop exec hook properly [NodeConformance]", func() {
lifecycle := &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"sh", "-c", "curl http://" + targetURL + ":8080/echo?msg=prestop"},
},
@ -127,7 +127,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
*/
framework.ConformanceIt("should execute poststart http hook properly [NodeConformance]", func() {
lifecycle := &v1.Lifecycle{
PostStart: &v1.Handler{
PostStart: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/echo?msg=poststart",
Host: targetIP,
@ -149,7 +149,7 @@ var _ = SIGDescribe("Container Lifecycle Hook", func() {
*/
framework.ConformanceIt("should execute prestop http hook properly [NodeConformance]", func() {
lifecycle := &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/echo?msg=prestop",
Host: targetIP,

View File

@ -558,7 +558,7 @@ func (config *NetworkingTestConfig) createNetShellPodSpec(podName, hostname stri
PeriodSeconds: 10,
SuccessThreshold: 1,
FailureThreshold: 3,
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/healthz",
Port: intstr.IntOrString{IntVal: EndpointHTTPPort},

View File

@ -646,7 +646,7 @@ func (j *TestJig) newRCTemplate() *v1.ReplicationController {
Args: []string{"netexec", "--http-port=80", "--udp-port=80"},
ReadinessProbe: &v1.Probe{
PeriodSeconds: 3,
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(80),
Path: "/hostName",

View File

@ -117,7 +117,7 @@ func hasPauseProbe(pod *v1.Pod) bool {
}
var pauseProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{Command: []string{"test", "-f", "/data/statefulset-continue"}},
},
PeriodSeconds: 1,

View File

@ -74,7 +74,7 @@ func pfPod(expectedClientData, chunks, chunkSize, chunkIntervalMillis string, bi
Image: imageutils.GetE2EImage(imageutils.Agnhost),
Args: []string{"netexec"},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{
"sh", "-c", "netstat -na | grep LISTEN | grep -v 8080 | grep 80",

View File

@ -174,7 +174,7 @@ func createHostPortPodOnNode(f *framework.Framework, podName, ns, hostIP string,
},
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/hostname",
Port: intstr.IntOrString{

View File

@ -2045,7 +2045,7 @@ func createServerPodAndService(f *framework.Framework, namespace *v1.Namespace,
},
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/agnhost", "connect", fmt.Sprintf("--protocol=%s", connectProtocol), "--timeout=1s", fmt.Sprintf("127.0.0.1:%d", portProtocol.port)},
},

View File

@ -163,7 +163,7 @@ var _ = common.SIGDescribe("Proxy", func() {
"tlsdest2": 462,
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(80),
},

View File

@ -463,7 +463,7 @@ func generateScaleTestBackendDeploymentSpec(numReplicas int32) *appsv1.Deploymen
Image: imageutils.GetE2EImage(imageutils.EchoServer),
Ports: []v1.ContainerPort{{ContainerPort: 8080}},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(8080),
Path: "/healthz",

View File

@ -1684,14 +1684,14 @@ var _ = common.SIGDescribe("Services", func() {
Image: t.Image,
Ports: []v1.ContainerPort{{ContainerPort: int32(port), Protocol: v1.ProtocolTCP}},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/false"},
},
},
},
Lifecycle: &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"/bin/sleep", fmt.Sprintf("%d", terminateSeconds)},
},

View File

@ -77,7 +77,7 @@ func testPreStop(c clientset.Interface, ns string) {
Image: imageutils.GetE2EImage(imageutils.BusyBox),
Command: []string{"sleep", "600"},
Lifecycle: &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{
"wget", "-O-", "--post-data=" + val, fmt.Sprintf("http://%s/write", podURL),
@ -225,7 +225,7 @@ func getPodWithpreStopLifeCycle(name string) *v1.Pod {
Name: "nginx",
Image: imageutils.GetE2EImage(imageutils.Nginx),
Lifecycle: &v1.Lifecycle{
PreStop: &v1.Handler{
PreStop: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: []string{"sh", "-c", "while true; do echo preStop; sleep 1; done"},
},

View File

@ -1045,7 +1045,7 @@ func createHostPortPodOnNode(f *framework.Framework, podName, ns, hostIP string,
},
},
ReadinessProbe: &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/hostname",
Port: intstr.IntOrString{

View File

@ -341,7 +341,7 @@ var _ = utils.SIGDescribe("PersistentVolumes", func() {
writeCmd += "&& sleep 10000"
probe := &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
// Check that the last file got created
Command: []string{"test", "-f", getVolumeFile(numVols - 1)},

View File

@ -882,7 +882,7 @@ func testPodContainerRestart(f *framework.Framework, pod *v1.Pod) {
testPodContainerRestartWithHooks(f, pod, &podContainerRestartHooks{
AddLivenessProbeFunc: func(p *v1.Pod, probeFilePath string) {
p.Spec.Containers[0].LivenessProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{"cat", probeFilePath},
},
@ -936,7 +936,7 @@ func TestPodContainerRestartWithConfigmapModified(f *framework.Framework, origin
testPodContainerRestartWithHooks(f, pod, &podContainerRestartHooks{
AddLivenessProbeFunc: func(p *v1.Pod, probeFilePath string) {
p.Spec.Containers[0].LivenessProbe = &v1.Probe{
Handler: v1.Handler{
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
// Expect probe file exist or configmap mounted file has been modified.
Command: []string{"sh", "-c", fmt.Sprintf("cat %s || test `cat %s` = '%s'", probeFilePath, volumePath, modifiedValue)},