Skip to content

Commit

Permalink
add Probes message to correctly handle IntOrString for 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciferInLove authored Feb 27, 2023
1 parent 6527279 commit ee2ee9a
Show file tree
Hide file tree
Showing 15 changed files with 4,436 additions and 2,638 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ KUSTOMIZE_VERSION = 4.1.2
ISTIO_VERSION = 1.17.1
BUF_VERSION = 1.7.0

PATH := $(PATH):$(PWD)/bin
PATH := $(PWD)/bin:$(PATH)

all: check manager

Expand Down
284 changes: 167 additions & 117 deletions api/v1alpha1/common.gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
}
},
"livenessProbe": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.Probe"
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.Probe"
},
"readinessProbe": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.Probe"
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.Probe"
},
"imagePullPolicy": {
"description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.",
Expand Down Expand Up @@ -192,6 +192,34 @@
}
}
},
"istio_operator.v2.api.v1alpha1.HTTPGetAction": {
"description": "HTTPGetAction describes an action based on HTTP Get requests.",
"type": "object",
"properties": {
"path": {
"description": "Path to access on the HTTP server.",
"type": "string"
},
"port": {
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.IntOrString"
},
"host": {
"description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.",
"type": "string"
},
"scheme": {
"description": "Scheme to use for connecting to the host. Defaults to HTTP.",
"type": "string"
},
"httpHeaders": {
"description": "Custom headers to set in the request. HTTP allows repeated headers.",
"type": "array",
"items": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.HTTPHeader"
}
}
}
},
"istio_operator.v2.api.v1alpha1.IntOrString": {
"description": "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number. GOTYPE: *IntOrString",
"oneOf": [
Expand Down Expand Up @@ -304,6 +332,130 @@
}
}
},
"istio_operator.v2.api.v1alpha1.Probe": {
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
"type": "object",
"properties": {
"timeoutSeconds": {
"description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
"type": "integer",
"format": "int32"
},
"terminationGracePeriodSeconds": {
"description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.",
"type": "integer",
"format": "int64"
},
"initialDelaySeconds": {
"description": "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",
"type": "integer",
"format": "int32"
},
"periodSeconds": {
"description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.",
"type": "integer",
"format": "int32"
},
"successThreshold": {
"description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.",
"type": "integer",
"format": "int32"
},
"failureThreshold": {
"description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.",
"type": "integer",
"format": "int32"
}
},
"oneOf": [
{
"not": {
"anyOf": [
{
"required": [
"exec"
],
"properties": {
"exec": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.ExecAction"
}
}
},
{
"required": [
"httpGet"
],
"properties": {
"httpGet": {
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.HTTPGetAction"
}
}
},
{
"required": [
"tcpSocket"
],
"properties": {
"tcpSocket": {
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.TCPSocketAction"
}
}
},
{
"required": [
"grpc"
],
"properties": {
"grpc": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.GRPCAction"
}
}
}
]
}
},
{
"required": [
"exec"
],
"properties": {
"exec": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.ExecAction"
}
}
},
{
"required": [
"httpGet"
],
"properties": {
"httpGet": {
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.HTTPGetAction"
}
}
},
{
"required": [
"tcpSocket"
],
"properties": {
"tcpSocket": {
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.TCPSocketAction"
}
}
},
{
"required": [
"grpc"
],
"properties": {
"grpc": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.GRPCAction"
}
}
}
]
},
"istio_operator.v2.api.v1alpha1.Quantity": {
"description": "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and Int64() accessors. GOTYPE: *Quantity",
"oneOf": [
Expand Down Expand Up @@ -467,6 +619,19 @@
}
}
},
"istio_operator.v2.api.v1alpha1.TCPSocketAction": {
"description": "TCPSocketAction describes an action based on opening a socket",
"type": "object",
"properties": {
"port": {
"$ref": "#/components/schemas/istio_operator.v2.api.v1alpha1.IntOrString"
},
"host": {
"description": "Optional: Host name to connect to, defaults to the pod IP.",
"type": "string"
}
}
},
"istio_operator.v2.api.v1alpha1.UnprotectedService": {
"description": "Service describes the attributes that a user creates on a service.",
"type": "object",
Expand Down Expand Up @@ -1075,34 +1240,6 @@
}
}
},
"k8s.io.api.core.v1.HTTPGetAction": {
"description": "HTTPGetAction describes an action based on HTTP Get requests.",
"type": "object",
"properties": {
"path": {
"description": "Path to access on the HTTP server.",
"type": "string"
},
"port": {
"$ref": "#/components/schemas/k8s.io.apimachinery.pkg.util.intstr.IntOrString"
},
"host": {
"description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.",
"type": "string"
},
"scheme": {
"description": "Scheme to use for connecting to the host. Defaults to HTTP.",
"type": "string"
},
"httpHeaders": {
"description": "Custom headers to set in the request. HTTP allows repeated headers.",
"type": "array",
"items": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.HTTPHeader"
}
}
}
},
"k8s.io.api.core.v1.HTTPHeader": {
"description": "HTTPHeader describes a custom header to be used in HTTP probes",
"type": "object",
Expand Down Expand Up @@ -1540,63 +1677,6 @@
}
}
},
"k8s.io.api.core.v1.Probe": {
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
"type": "object",
"properties": {
"timeoutSeconds": {
"description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
"type": "integer",
"format": "int32"
},
"terminationGracePeriodSeconds": {
"description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.",
"type": "integer",
"format": "int64"
},
"handler": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.ProbeHandler"
},
"initialDelaySeconds": {
"description": "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",
"type": "integer",
"format": "int32"
},
"periodSeconds": {
"description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.",
"type": "integer",
"format": "int32"
},
"successThreshold": {
"description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.",
"type": "integer",
"format": "int32"
},
"failureThreshold": {
"description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.",
"type": "integer",
"format": "int32"
}
}
},
"k8s.io.api.core.v1.ProbeHandler": {
"description": "ProbeHandler defines a specific action that should be taken in a probe. One and only one of the fields must be specified.",
"type": "object",
"properties": {
"exec": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.ExecAction"
},
"httpGet": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.HTTPGetAction"
},
"tcpSocket": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.TCPSocketAction"
},
"grpc": {
"$ref": "#/components/schemas/k8s.io.api.core.v1.GRPCAction"
}
}
},
"k8s.io.api.core.v1.ProjectedVolumeSource": {
"description": "Represents a projected volume source",
"type": "object",
Expand Down Expand Up @@ -1981,19 +2061,6 @@
}
}
},
"k8s.io.api.core.v1.TCPSocketAction": {
"description": "TCPSocketAction describes an action based on opening a socket",
"type": "object",
"properties": {
"port": {
"$ref": "#/components/schemas/k8s.io.apimachinery.pkg.util.intstr.IntOrString"
},
"host": {
"description": "Optional: Host name to connect to, defaults to the pod IP.",
"type": "string"
}
}
},
"k8s.io.api.core.v1.Toleration": {
"description": "The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.",
"type": "object",
Expand Down Expand Up @@ -2496,23 +2563,6 @@
"format": "int32"
}
}
},
"k8s.io.apimachinery.pkg.util.intstr.IntOrString": {
"description": "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number. TODO: Rename to Int32OrString",
"type": "object",
"properties": {
"type": {
"type": "integer",
"format": "int64"
},
"intVal": {
"type": "integer",
"format": "int32"
},
"strVal": {
"type": "string"
}
}
}
}
}
Expand Down
Loading

0 comments on commit ee2ee9a

Please sign in to comment.