diff --git a/config/prow/cluster/prowjob-crd/prowjob_customresourcedefinition.yaml b/config/prow/cluster/prowjob-crd/prowjob_customresourcedefinition.yaml index 7384d1466ee4..ac1936351ff4 100644 --- a/config/prow/cluster/prowjob-crd/prowjob_customresourcedefinition.yaml +++ b/config/prow/cluster/prowjob-crd/prowjob_customresourcedefinition.yaml @@ -586,6 +586,7 @@ spec: - value type: object type: array + x-kubernetes-list-type: atomic pipelineRef: description: 'PipelineRef can be used to refer to a specific instance of a Pipeline. Copied from CrossVersionObjectReference: https://github.com/kubernetes/kubernetes/blob/169df7434155cbbc22f1532cba8e0a9588e29ad8/pkg/apis/autoscaling/types.go#L64' @@ -635,6 +636,7045 @@ spec: description: Description is a user-facing description of the pipeline that may be used to populate a UI. type: string + finally: + description: Finally declares the list of Tasks that execute + just before leaving the Pipeline i.e. either after all Tasks + are finished executing successfully or after a failure which + would result in ending the Pipeline + items: + description: PipelineTask defines a task in a Pipeline, + passing inputs from both Params and from the output of + previous tasks. + properties: + conditions: + description: Conditions is a list of conditions that + need to be true for the task to run Conditions are + deprecated, use WhenExpressions instead + items: + description: PipelineTaskCondition allows a PipelineTask + to declare a Condition to be evaluated before the + Task is run. + properties: + conditionRef: + description: ConditionRef is the name of the Condition + to use for the conditionCheck + type: string + params: + description: Params declare parameters passed + to this Condition + items: + description: Param declares an ArrayOrString + to use for the parameter called name. + properties: + name: + type: string + value: + description: 'ArrayOrString is a type that + can hold a single string or string array. + Used in JSON unmarshalling so that a single + JSON field can accept either an individual + string or an array of strings. TODO (@chuangw6): + This struct will be renamed or be embedded + in a new struct to take into consideration + the object case after the community reaches + an agreement on it.' + properties: + arrayVal: + items: + type: string + type: array + x-kubernetes-list-type: atomic + objectVal: + additionalProperties: + type: string + type: object + stringVal: + type: string + type: + description: ParamType indicates the + type of an input parameter; Used to + distinguish between a single string + and an array of strings. + type: string + required: + - arrayVal + - objectVal + - stringVal + - type + type: object + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + resources: + description: Resources declare the resources provided + to this Condition as input + items: + description: PipelineTaskInputResource maps + the name of a declared PipelineResource input + dependency in a Task to the resource in the + Pipeline's DeclaredPipelineResources that + should be used. This input may come from a + previous task. + properties: + from: + description: From is the list of PipelineTask + names that the resource has to come from. + (Implies an ordering in the execution + graph.) + items: + type: string + type: array + x-kubernetes-list-type: atomic + name: + description: Name is the name of the PipelineResource + as declared by the Task. + type: string + resource: + description: Resource is the name of the + DeclaredPipelineResource to use. + type: string + required: + - name + - resource + type: object + type: array + x-kubernetes-list-type: atomic + required: + - conditionRef + type: object + type: array + x-kubernetes-list-type: atomic + matrix: + description: Matrix declares parameters used to fan + out this task. + items: + description: Param declares an ArrayOrString to use + for the parameter called name. + properties: + name: + type: string + value: + description: 'ArrayOrString is a type that can + hold a single string or string array. Used in + JSON unmarshalling so that a single JSON field + can accept either an individual string or an + array of strings. TODO (@chuangw6): This struct + will be renamed or be embedded in a new struct + to take into consideration the object case after + the community reaches an agreement on it.' + properties: + arrayVal: + items: + type: string + type: array + x-kubernetes-list-type: atomic + objectVal: + additionalProperties: + type: string + type: object + stringVal: + type: string + type: + description: ParamType indicates the type + of an input parameter; Used to distinguish + between a single string and an array of + strings. + type: string + required: + - arrayVal + - objectVal + - stringVal + - type + type: object + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + name: + description: Name is the name of this task within the + context of a Pipeline. Name is used as a coordinate + with the `from` and `runAfter` fields to establish + the execution order of tasks relative to one another. + type: string + params: + description: Parameters declares parameters passed to + this task. + items: + description: Param declares an ArrayOrString to use + for the parameter called name. + properties: + name: + type: string + value: + description: 'ArrayOrString is a type that can + hold a single string or string array. Used in + JSON unmarshalling so that a single JSON field + can accept either an individual string or an + array of strings. TODO (@chuangw6): This struct + will be renamed or be embedded in a new struct + to take into consideration the object case after + the community reaches an agreement on it.' + properties: + arrayVal: + items: + type: string + type: array + x-kubernetes-list-type: atomic + objectVal: + additionalProperties: + type: string + type: object + stringVal: + type: string + type: + description: ParamType indicates the type + of an input parameter; Used to distinguish + between a single string and an array of + strings. + type: string + required: + - arrayVal + - objectVal + - stringVal + - type + type: object + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + resources: + description: Resources declares the resources given + to this task as inputs and outputs. + properties: + inputs: + description: Inputs holds the mapping from the PipelineResources + declared in DeclaredPipelineResources to the input + PipelineResources required by the Task. + items: + description: PipelineTaskInputResource maps the + name of a declared PipelineResource input dependency + in a Task to the resource in the Pipeline's + DeclaredPipelineResources that should be used. + This input may come from a previous task. + properties: + from: + description: From is the list of PipelineTask + names that the resource has to come from. + (Implies an ordering in the execution graph.) + items: + type: string + type: array + x-kubernetes-list-type: atomic + name: + description: Name is the name of the PipelineResource + as declared by the Task. + type: string + resource: + description: Resource is the name of the DeclaredPipelineResource + to use. + type: string + required: + - name + - resource + type: object + type: array + x-kubernetes-list-type: atomic + outputs: + description: Outputs holds the mapping from the + PipelineResources declared in DeclaredPipelineResources + to the input PipelineResources required by the + Task. + items: + description: PipelineTaskOutputResource maps the + name of a declared PipelineResource output dependency + in a Task to the resource in the Pipeline's + DeclaredPipelineResources that should be used. + properties: + name: + description: Name is the name of the PipelineResource + as declared by the Task. + type: string + resource: + description: Resource is the name of the DeclaredPipelineResource + to use. + type: string + required: + - name + - resource + type: object + type: array + x-kubernetes-list-type: atomic + type: object + retries: + description: 'Retries represents how many times this + task should be retried in case of task failure: ConditionSucceeded + set to False' + type: integer + runAfter: + description: RunAfter is the list of PipelineTask names + that should be executed before this Task executes. + (Used to force a specific ordering in graph execution.) + items: + type: string + type: array + x-kubernetes-list-type: atomic + taskRef: + description: TaskRef is a reference to a task definition. + properties: + apiVersion: + description: API version of the referent + type: string + bundle: + description: Bundle url reference to a Tekton Bundle. + type: string + kind: + description: TaskKind indicates the kind of the + task, namespaced or cluster scoped. + type: string + name: + description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + resolver: + description: Resolver is the name of the resolver + that should perform resolution of the referenced + Tekton resource, such as "git". + type: string + resource: + description: Resource contains the parameters used + to identify the referenced Tekton resource. Example + entries might include "repo" or "path" but the + set of params ultimately depends on the chosen + resolver. + items: + description: ResolverParam is a single parameter + passed to a resolver. + properties: + name: + description: Name is the name of the parameter + that will be passed to the resolver. + type: string + value: + description: Value is the string value of + the parameter that will be passed to the + resolver. + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + type: object + taskSpec: + description: TaskSpec is a specification of a task + properties: + apiVersion: + type: string + description: + description: Description is a user-facing description + of the task that may be used to populate a UI. + type: string + kind: + type: string + metadata: + description: PipelineTaskMetadata contains the labels + or annotations for an EmbeddedTask + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + params: + description: Params is a list of input parameters + required to run the task. Params must be supplied + as inputs in TaskRuns unless they declare a default + value. + items: + description: ParamSpec defines arbitrary parameters + needed beyond typed inputs (such as resources). + Parameter values are provided by users as inputs + on a TaskRun or PipelineRun. + properties: + default: + description: Default is the value a parameter + takes if no input value is supplied. If + default is set, a Task may be executed without + a supplied value for the parameter. + properties: + arrayVal: + items: + type: string + type: array + x-kubernetes-list-type: atomic + objectVal: + additionalProperties: + type: string + type: object + stringVal: + type: string + type: + description: ParamType indicates the type + of an input parameter; Used to distinguish + between a single string and an array + of strings. + type: string + required: + - arrayVal + - objectVal + - stringVal + - type + type: object + description: + description: Description is a user-facing + description of the parameter that may be + used to populate a UI. + type: string + name: + description: Name declares the name by which + a parameter is referenced. + type: string + properties: + additionalProperties: + description: PropertySpec defines the struct + for object keys + properties: + type: + description: ParamType indicates the + type of an input parameter; Used to + distinguish between a single string + and an array of strings. + type: string + type: object + description: Properties is the JSON Schema + properties to support key-value pairs parameter. + type: object + type: + description: Type is the user-specified type + of the parameter. The possible types are + currently "string", "array" and "object", + and "string" is the default. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + resources: + description: Resources is a list input and output + resource to run the task Resources are represented + in TaskRuns as bindings to instances of PipelineResources. + properties: + inputs: + description: Inputs holds the mapping from the + PipelineResources declared in DeclaredPipelineResources + to the input PipelineResources required by + the Task. + items: + description: TaskResource defines an input + or output Resource declared as a requirement + by a Task. The Name field will be used to + refer to these Resources within the Task + definition, and when provided as an Input, + the Name will be the path to the volume + mounted containing this Resource as an input + (e.g. an input Resource named `workspace` + will be mounted at `/workspace`). + properties: + description: + description: Description is a user-facing + description of the declared resource + that may be used to populate a UI. + type: string + name: + description: Name declares the name by + which a resource is referenced in the + definition. Resources may be referenced + by name in the definition of a Task's + steps. + type: string + optional: + description: 'Optional declares the resource + as optional. By default optional is + set to false which makes a resource + required. optional: true - the resource + is considered optional optional: false + - the resource is considered required + (equivalent of not specifying it)' + type: boolean + targetPath: + description: TargetPath is the path in + workspace directory where the resource + will be copied. + type: string + type: + description: Type is the type of this + resource; + type: string + required: + - name + - type + type: object + type: array + x-kubernetes-list-type: atomic + outputs: + description: Outputs holds the mapping from + the PipelineResources declared in DeclaredPipelineResources + to the input PipelineResources required by + the Task. + items: + description: TaskResource defines an input + or output Resource declared as a requirement + by a Task. The Name field will be used to + refer to these Resources within the Task + definition, and when provided as an Input, + the Name will be the path to the volume + mounted containing this Resource as an input + (e.g. an input Resource named `workspace` + will be mounted at `/workspace`). + properties: + description: + description: Description is a user-facing + description of the declared resource + that may be used to populate a UI. + type: string + name: + description: Name declares the name by + which a resource is referenced in the + definition. Resources may be referenced + by name in the definition of a Task's + steps. + type: string + optional: + description: 'Optional declares the resource + as optional. By default optional is + set to false which makes a resource + required. optional: true - the resource + is considered optional optional: false + - the resource is considered required + (equivalent of not specifying it)' + type: boolean + targetPath: + description: TargetPath is the path in + workspace directory where the resource + will be copied. + type: string + type: + description: Type is the type of this + resource; + type: string + required: + - name + - type + type: object + type: array + x-kubernetes-list-type: atomic + type: object + results: + description: Results are values that this Task can + output + items: + description: TaskResult used to describe the results + of a task + properties: + description: + description: Description is a human-readable + description of the result + type: string + name: + description: Name the given name + type: string + type: + description: Type is the user-specified type + of the result. The possible type is currently + "string" and will support "array" in following + work. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + sidecars: + description: Sidecars are run alongside the Task's + step containers. They begin before the steps start + and end after the steps complete. + items: + description: Sidecar has nearly the same data + structure as Step but does not have the ability + to timeout. + properties: + args: + description: 'Arguments to the entrypoint. + The docker image''s CMD is used if this + is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. + If a variable cannot be resolved, the reference + in the input string will be unchanged. Double + $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal + "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + description: 'Entrypoint array. Not executed + within a shell. The docker image''s ENTRYPOINT + is used if this is not provided. Variable + references $(VAR_NAME) are expanded using + the container''s environment. If a variable + cannot be resolved, the reference in the + input string will be unchanged. Double $$ + are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal + "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + description: List of environment variables + to set in the container. Cannot be updated. + items: + description: EnvVar represents an environment + variable present in a Container. + properties: + name: + description: Name of the environment + variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) + are expanded using the previously + defined environment variables in the + container and any service environment + variables. If a variable cannot be + resolved, the reference in the input + string will be unchanged. Double $$ + are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: + i.e. "$$(VAR_NAME)" will produce the + string literal "$(VAR_NAME)". Escaped + references will never be expanded, + regardless of whether the variable + exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment + variable's value. Cannot be used if + value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a + ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether + the ConfigMap or its key must + be defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of + the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, + status.hostIP, status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the + schema the FieldPath is written + in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field + to select in the specified + API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource + of the container: only resources + limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, + requests.cpu, requests.memory + and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: + required for volumes, optional + for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource + to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a + secret in the pod's namespace + properties: + key: + description: The key of the + secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether + the Secret or its key must + be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + envFrom: + description: List of sources to populate environment + variables in the container. The keys defined + within a source must be a C_IDENTIFIER. + All invalid keys will be reported as an + event when the container is starting. When + a key exists in multiple sources, the value + associated with the last source will take + precedence. Values defined by an Env with + a duplicate key will take precedence. Cannot + be updated. + items: + description: EnvFromSource represents the + source of a set of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select + from + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the + ConfigMap must be defined + type: boolean + type: object + prefix: + description: An optional identifier + to prepend to each key in the ConfigMap. + Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the + Secret must be defined + type: boolean + type: object + type: object + type: array + x-kubernetes-list-type: atomic + image: + description: 'Docker image name. More info: + https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level + config management to default or override + container images in workload controllers + like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, + Never, IfNotPresent. Defaults to Always + if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. More info: + https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system + should take in response to container lifecycle + events. Cannot be updated. + properties: + postStart: + 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' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the + command is root ('/') in the + container's filesystem. The + command is simply exec'd, it + is not run inside a shell, so + traditional shell instructions + ('|', etc) won't work. To use + a shell, you need to explicitly + call out to that shell. Exit + status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the + http request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. + You probably want to set "Host" + in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to + set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes + a custom header to be used + in HTTP probes + properties: + name: + description: The header + field name + type: string + value: + description: The header + field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on + the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for + connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket + is NOT supported as a LifecycleHandler + and kept for the backward compatibility. + There are no validation of this + field and lifecycle hooks will fail + in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the + pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + 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 Pod''s termination + grace period countdown begins before + the PreStop hook is executed. Regardless + of the outcome of the handler, the container + will eventually terminate within the + Pod''s termination grace period (unless + delayed by finalizers). 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' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the + command is root ('/') in the + container's filesystem. The + command is simply exec'd, it + is not run inside a shell, so + traditional shell instructions + ('|', etc) won't work. To use + a shell, you need to explicitly + call out to that shell. Exit + status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the + http request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. + You probably want to set "Host" + in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to + set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes + a custom header to be used + in HTTP probes + properties: + name: + description: The header + field name + type: string + value: + description: The header + field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on + the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for + connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket + is NOT supported as a LifecycleHandler + and kept for the backward compatibility. + There are no validation of this + field and lifecycle hooks will fail + in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the + pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Periodic probe of container + liveness. Container will be restarted if + the probe fails. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it + is not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to + 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action + involving a GRPC port. This is a beta + field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name + of the service to place in the gRPC + HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the + default behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to + perform the probe. Default to 10 seconds. + Minimum value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the pod + IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + name: + description: Name of the container specified + as a DNS_LABEL. Each container in a pod + must have a unique name (DNS_LABEL). Cannot + be updated. + type: string + ports: + description: List of ports to expose from + the container. Exposing a port here gives + the system additional information about + the network connections a container uses, + but is primarily informational. Not specifying + a port here DOES NOT prevent that port from + being exposed. Any port which is listening + on the default "0.0.0.0" address inside + a container will be accessible from the + network. Cannot be updated. + items: + description: ContainerPort represents a + network port in a single container. + properties: + containerPort: + description: Number of port to expose + on the pod's IP address. This must + be a valid port number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the + external port to. + type: string + hostPort: + description: Number of port to expose + on the host. If specified, this must + be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this + must match ContainerPort. Most containers + do not need this. + format: int32 + type: integer + name: + description: If specified, this must + be an IANA_SVC_NAME and unique within + the pod. Each named port in a pod + must have a unique name. Name for + the port that can be referred to by + services. + type: string + protocol: + default: TCP + description: Protocol for port. Must + be UDP, TCP, or SCTP. Defaults to + "TCP". + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container + service readiness. Container will be removed + from service endpoints if the probe fails. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it + is not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to + 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action + involving a GRPC port. This is a beta + field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name + of the service to place in the gRPC + HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the + default behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to + perform the probe. Default to 10 seconds. + Minimum value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the pod + IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by + this container. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum + amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum + amount of compute resources required. + If Requests is omitted for a container, + it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + script: + description: "Script is the contents of an + executable file to execute. \n If Script + is not empty, the Step cannot have an Command + or Args." + type: string + securityContext: + description: 'SecurityContext defines the + security options the container should be + run with. If set, the fields of SecurityContext + override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation + controls whether a process can gain + more privileges than its parent process. + This bool directly controls if the no_new_privs + flag will be set on the container process. + AllowPrivilegeEscalation is true always + when the container is: 1) run as Privileged + 2) has CAP_SYS_ADMIN Note that this + field cannot be set when spec.os.name + is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop + when running containers. Defaults to + the default set of capabilities granted + by the container runtime. Note that + this field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent + POSIX capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent + POSIX capabilities type + type: string + type: array + type: object + privileged: + description: Run container in privileged + mode. Processes in privileged containers + are essentially equivalent to root on + the host. Defaults to false. Note that + this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: procMount denotes the type + of proc mount to use for the containers. + The default is DefaultProcMount which + uses the container runtime defaults + for readonly paths and masked paths. + This requires the ProcMountType feature + flag to be enabled. Note that this field + cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has + a read-only root filesystem. Default + is false. Note that this field cannot + be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint + of the container process. Uses runtime + default if unset. May also be set in + PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container + must run as a non-root user. If true, + the Kubelet will validate the image + at runtime to ensure that it does not + run as UID 0 (root) and fail to start + the container if it does. If unset or + false, no such validation will be performed. + May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint + of the container process. Defaults to + user specified in image metadata if + unspecified. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be + applied to the container. If unspecified, + the container runtime will allocate + a random SELinux context for each container. May + also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + properties: + level: + description: Level is SELinux level + label that applies to the container. + type: string + role: + description: Role is a SELinux role + label that applies to the container. + type: string + type: + description: Type is a SELinux type + label that applies to the container. + type: string + user: + description: User is a SELinux user + label that applies to the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use + by this container. If seccomp options + are provided at both the pod & container + level, the container options override + the pod options. Note that this field + cannot be set when spec.os.name is windows. + properties: + localhostProfile: + description: localhostProfile indicates + a profile defined in a file on the + node should be used. The profile + must be preconfigured on the node + to work. Must be a descending path, + relative to the kubelet's configured + seccomp profile location. Must only + be set if type is "Localhost". + type: string + type: + description: "type indicates which + kind of seccomp profile will be + applied. Valid options are: \n Localhost + - a profile defined in a file on + the node should be used. RuntimeDefault + - the container runtime default + profile should be used. Unconfined + - no profile should be applied." + type: string + required: + - type + type: object + windowsOptions: + description: The Windows specific settings + applied to all containers. If unspecified, + the options from the PodSecurityContext + will be used. If set in both SecurityContext + and PodSecurityContext, the value specified + in SecurityContext takes precedence. + Note that this field cannot be set when + spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is + where the GMSA admission webhook + (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA + credential spec named by the GMSACredentialSpecName + field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName + is the name of the GMSA credential + spec to use. + type: string + hostProcess: + description: HostProcess determines + if a container should be run as + a 'Host Process' container. This + field is alpha-level and will only + be honored by components that enable + the WindowsHostProcessContainers + feature flag. Setting this field + without the feature flag will result + in errors when validating the Pod. + All of a Pod's containers must have + the same effective HostProcess value + (it is not allowed to have a mix + of HostProcess containers and non-HostProcess + containers). In addition, if HostProcess + is true then HostNetwork must also + be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows + to run the entrypoint of the container + process. Defaults to the user specified + in image metadata if unspecified. + May also be set in PodSecurityContext. + If set in both SecurityContext and + PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'StartupProbe indicates that + the Pod has successfully initialized. If + specified, no other probes are executed + until this completes successfully. If this + probe fails, the Pod will be restarted, + just as if the livenessProbe failed. This + can be used to provide different probe parameters + at the beginning of a Pod''s lifecycle, + when it might take a long time to load data + or warm a cache, than during steady-state + operation. This cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it + is not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to + 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action + involving a GRPC port. This is a beta + field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name + of the service to place in the gRPC + HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the + default behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to + perform the probe. Default to 10 seconds. + Minimum value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the pod + IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + stdin: + description: Whether this container should + allocate a buffer for stdin in the container + runtime. If this is not set, reads from + stdin in the container will always result + in EOF. Default is false. + type: boolean + stdinOnce: + description: Whether the container runtime + should close the stdin channel after it + has been opened by a single attach. When + stdin is true the stdin stream will remain + open across multiple attach sessions. If + stdinOnce is set to true, stdin is opened + on container start, is empty until the first + client attaches to stdin, and then remains + open and accepts data until the client disconnects, + at which time stdin is closed and remains + closed until the container is restarted. + If this flag is false, a container processes + that reads from stdin will never receive + an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the + file to which the container''s termination + message will be written is mounted into + the container''s filesystem. Message written + is intended to be brief final status, such + as an assertion failure message. Will be + truncated by the node if greater than 4096 + bytes. The total message length across all + containers will be limited to 12kb. Defaults + to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination + message should be populated. File will use + the contents of terminationMessagePath to + populate the container status message on + both success and failure. FallbackToLogsOnError + will use the last chunk of container log + output if the termination message file is + empty and the container exited with an error. + The log output is limited to 2048 bytes + or 80 lines, whichever is smaller. Defaults + to File. Cannot be updated. + type: string + tty: + description: Whether this container should + allocate a TTY for itself, also requires + 'stdin' to be true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of + block devices to be used by the container. + items: + description: volumeDevice describes a mapping + of a raw block device within a container. + properties: + devicePath: + description: devicePath is the path + inside of the container that the device + will be mapped to. + type: string + name: + description: name must match the name + of a persistentVolumeClaim in the + pod + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-type: atomic + volumeMounts: + description: Pod volumes to mount into the + container's filesystem. Cannot be updated. + items: + description: VolumeMount describes a mounting + of a Volume within a container. + properties: + mountPath: + description: Path within the container + at which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines + how mounts are propagated from the + host to container and the other way + around. When not set, MountPropagationNone + is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name + of a Volume. + type: string + readOnly: + description: Mounted read-only if true, + read-write otherwise (false or unspecified). + Defaults to false. + type: boolean + subPath: + description: Path within the volume + from which the container's volume + should be mounted. Defaults to "" + (volume's root). + type: string + subPathExpr: + description: Expanded path within the + volume from which the container's + volume should be mounted. Behaves + similarly to SubPath but environment + variable references $(VAR_NAME) are + expanded using the container's environment. + Defaults to "" (volume's root). SubPathExpr + and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-type: atomic + workingDir: + description: Container's working directory. + If not specified, the container runtime's + default will be used, which might be configured + in the container image. Cannot be updated. + type: string + workspaces: + description: "This is an alpha field. You + must set the \"enable-api-fields\" feature + flag to \"alpha\" for this field to be supported. + \n Workspaces is a list of workspaces from + the Task that this Sidecar wants exclusive + access to. Adding a workspace to this list + means that any other Step or Sidecar that + does not also request this Workspace will + not have access to it." + items: + description: WorkspaceUsage is used by a + Step or Sidecar to declare that it wants + isolated access to a Workspace defined + in a Task. + properties: + mountPath: + description: MountPath is the path that + the workspace should be mounted to + inside the Step or Sidecar, overriding + any MountPath specified in the Task's + WorkspaceDeclaration. + type: string + name: + description: Name is the name of the + workspace this Step or Sidecar wants + access to. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-type: atomic + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + spec: + description: Spec is a specification of a custom + task + type: object + stepTemplate: + description: StepTemplate can be used as the basis + for all step containers within the Task, so that + the steps inherit settings on the base container. + properties: + args: + description: 'Arguments to the entrypoint. The + docker image''s CMD is used if this is not + provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. + If a variable cannot be resolved, the reference + in the input string will be unchanged. Double + $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal + "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + description: 'Entrypoint array. Not executed + within a shell. The docker image''s ENTRYPOINT + is used if this is not provided. Variable + references $(VAR_NAME) are expanded using + the container''s environment. If a variable + cannot be resolved, the reference in the input + string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the + $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, + regardless of whether the variable exists + or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + description: List of environment variables to + set in the container. Cannot be updated. + items: + description: EnvVar represents an environment + variable present in a Container. + properties: + name: + description: Name of the environment variable. + Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) + are expanded using the previously defined + environment variables in the container + and any service environment variables. + If a variable cannot be resolved, the + reference in the input string will be + unchanged. Double $$ are reduced to + a single $, which allows for escaping + the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, + regardless of whether the variable exists + or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment + variable's value. Cannot be used if + value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the + ConfigMap or its key must be + defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of the + pod: supports metadata.name, metadata.namespace, + `metadata.labels['''']`, `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, + status.hostIP, status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema + the FieldPath is written in + terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field + to select in the specified API + version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of + the container: only resources limits + and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: + required for volumes, optional + for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource + to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret + in the pod's namespace + properties: + key: + description: The key of the secret + to select from. Must be a valid + secret key. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the + Secret or its key must be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + envFrom: + description: List of sources to populate environment + variables in the container. The keys defined + within a source must be a C_IDENTIFIER. All + invalid keys will be reported as an event + when the container is starting. When a key + exists in multiple sources, the value associated + with the last source will take precedence. + Values defined by an Env with a duplicate + key will take precedence. Cannot be updated. + items: + description: EnvFromSource represents the + source of a set of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select from + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + must be defined + type: boolean + type: object + prefix: + description: An optional identifier to + prepend to each key in the ConfigMap. + Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + must be defined + type: boolean + type: object + type: object + type: array + x-kubernetes-list-type: atomic + image: + description: 'Docker image name. More info: + https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level + config management to default or override container + images in workload controllers like Deployments + and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, + Never, IfNotPresent. Defaults to Always if + :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Deprecated. This field will be + removed in a future release. Actions that + the management system should take in response + to container lifecycle events. Cannot be updated. + properties: + postStart: + 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' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the + command is root ('/') in the + container's filesystem. The command + is simply exec'd, it is not run + inside a shell, so traditional + shell instructions ('|', etc) + won't work. To use a shell, you + need to explicitly call out to + that shell. Exit status of 0 is + treated as live/healthy and non-zero + is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in + httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket is + NOT supported as a LifecycleHandler + and kept for the backward compatibility. + There are no validation of this field + and lifecycle hooks will fail in runtime + when tcp handler is specified. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the + pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + 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 Pod''s termination grace + period countdown begins before the PreStop + hook is executed. Regardless of the outcome + of the handler, the container will eventually + terminate within the Pod''s termination + grace period (unless delayed by finalizers). + 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' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the + command is root ('/') in the + container's filesystem. The command + is simply exec'd, it is not run + inside a shell, so traditional + shell instructions ('|', etc) + won't work. To use a shell, you + need to explicitly call out to + that shell. Exit status of 0 is + treated as live/healthy and non-zero + is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in + httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket is + NOT supported as a LifecycleHandler + and kept for the backward compatibility. + There are no validation of this field + and lifecycle hooks will fail in runtime + when tcp handler is specified. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the + pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Deprecated. This field will be + removed in a future release. Periodic probe + of container liveness. Container will be restarted + if the probe fails. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to + take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to 3. + Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving + a GRPC port. This is a beta field and + requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of + the service to place in the gRPC HealthCheckRequest + (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default + behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + name: + description: Deprecated. This field will be + removed in a future release. DeprecatedName + of the container specified as a DNS_LABEL. + Each container in a pod must have a unique + name (DNS_LABEL). Cannot be updated. + type: string + ports: + description: Deprecated. This field will be + removed in a future release. List of ports + to expose from the container. Exposing a port + here gives the system additional information + about the network connections a container + uses, but is primarily informational. Not + specifying a port here DOES NOT prevent that + port from being exposed. Any port which is + listening on the default "0.0.0.0" address + inside a container will be accessible from + the network. Cannot be updated. + items: + description: ContainerPort represents a network + port in a single container. + properties: + containerPort: + description: Number of port to expose + on the pod's IP address. This must be + a valid port number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the + external port to. + type: string + hostPort: + description: Number of port to expose + on the host. If specified, this must + be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this must + match ContainerPort. Most containers + do not need this. + format: int32 + type: integer + name: + description: If specified, this must be + an IANA_SVC_NAME and unique within the + pod. Each named port in a pod must have + a unique name. Name for the port that + can be referred to by services. + type: string + protocol: + default: TCP + description: Protocol for port. Must be + UDP, TCP, or SCTP. Defaults to "TCP". + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Deprecated. This field will be + removed in a future release. Periodic probe + of container service readiness. Container + will be removed from service endpoints if + the probe fails. Cannot be updated. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to + take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to 3. + Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving + a GRPC port. This is a beta field and + requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of + the service to place in the gRPC HealthCheckRequest + (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default + behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by + this container. Cannot be updated. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum + amount of compute resources allowed. More + info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum + amount of compute resources required. + If Requests is omitted for a container, + it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + securityContext: + description: 'SecurityContext defines the security + options the container should be run with. + If set, the fields of SecurityContext override + the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls + whether a process can gain more privileges + than its parent process. This bool directly + controls if the no_new_privs flag will + be set on the container process. AllowPrivilegeEscalation + is true always when the container is: + 1) run as Privileged 2) has CAP_SYS_ADMIN + Note that this field cannot be set when + spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop + when running containers. Defaults to the + default set of capabilities granted by + the container runtime. Note that this + field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent + POSIX capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent + POSIX capabilities type + type: string + type: array + type: object + privileged: + description: Run container in privileged + mode. Processes in privileged containers + are essentially equivalent to root on + the host. Defaults to false. Note that + this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: procMount denotes the type + of proc mount to use for the containers. + The default is DefaultProcMount which + uses the container runtime defaults for + readonly paths and masked paths. This + requires the ProcMountType feature flag + to be enabled. Note that this field cannot + be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has + a read-only root filesystem. Default is + false. Note that this field cannot be + set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint + of the container process. Uses runtime + default if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container + must run as a non-root user. If true, + the Kubelet will validate the image at + runtime to ensure that it does not run + as UID 0 (root) and fail to start the + container if it does. If unset or false, + no such validation will be performed. + May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint + of the container process. Defaults to + user specified in image metadata if unspecified. + May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied + to the container. If unspecified, the + container runtime will allocate a random + SELinux context for each container. May + also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + properties: + level: + description: Level is SELinux level + label that applies to the container. + type: string + role: + description: Role is a SELinux role + label that applies to the container. + type: string + type: + description: Type is a SELinux type + label that applies to the container. + type: string + user: + description: User is a SELinux user + label that applies to the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use + by this container. If seccomp options + are provided at both the pod & container + level, the container options override + the pod options. Note that this field + cannot be set when spec.os.name is windows. + properties: + localhostProfile: + description: localhostProfile indicates + a profile defined in a file on the + node should be used. The profile must + be preconfigured on the node to work. + Must be a descending path, relative + to the kubelet's configured seccomp + profile location. Must only be set + if type is "Localhost". + type: string + type: + description: "type indicates which kind + of seccomp profile will be applied. + Valid options are: \n Localhost - + a profile defined in a file on the + node should be used. RuntimeDefault + - the container runtime default profile + should be used. Unconfined - no profile + should be applied." + type: string + required: + - type + type: object + windowsOptions: + description: The Windows specific settings + applied to all containers. If unspecified, + the options from the PodSecurityContext + will be used. If set in both SecurityContext + and PodSecurityContext, the value specified + in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name + is linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where + the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential + spec named by the GMSACredentialSpecName + field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName + is the name of the GMSA credential + spec to use. + type: string + hostProcess: + description: HostProcess determines + if a container should be run as a + 'Host Process' container. This field + is alpha-level and will only be honored + by components that enable the WindowsHostProcessContainers + feature flag. Setting this field without + the feature flag will result in errors + when validating the Pod. All of a + Pod's containers must have the same + effective HostProcess value (it is + not allowed to have a mix of HostProcess + containers and non-HostProcess containers). In + addition, if HostProcess is true then + HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows + to run the entrypoint of the container + process. Defaults to the user specified + in image metadata if unspecified. + May also be set in PodSecurityContext. + If set in both SecurityContext and + PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'Deprecated. This field will be + removed in a future release. DeprecatedStartupProbe + indicates that the Pod has successfully initialized. + If specified, no other probes are executed + until this completes successfully. If this + probe fails, the Pod will be restarted, just + as if the livenessProbe failed. This can be + used to provide different probe parameters + at the beginning of a Pod''s lifecycle, when + it might take a long time to load data or + warm a cache, than during steady-state operation. + This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action to + take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to 3. + Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving + a GRPC port. This is a beta field and + requires enabling GRPCContainerProbe feature + gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name of + the service to place in the gRPC HealthCheckRequest + (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default + behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + stdin: + description: Deprecated. This field will be + removed in a future release. Whether this + container should allocate a buffer for stdin + in the container runtime. If this is not set, + reads from stdin in the container will always + result in EOF. Default is false. + type: boolean + stdinOnce: + description: Deprecated. This field will be + removed in a future release. Whether the container + runtime should close the stdin channel after + it has been opened by a single attach. When + stdin is true the stdin stream will remain + open across multiple attach sessions. If stdinOnce + is set to true, stdin is opened on container + start, is empty until the first client attaches + to stdin, and then remains open and accepts + data until the client disconnects, at which + time stdin is closed and remains closed until + the container is restarted. If this flag is + false, a container processes that reads from + stdin will never receive an EOF. Default is + false + type: boolean + terminationMessagePath: + description: 'Deprecated. This field will be + removed in a future release. Optional: Path + at which the file to which the container''s + termination message will be written is mounted + into the container''s filesystem. Message + written is intended to be brief final status, + such as an assertion failure message. Will + be truncated by the node if greater than 4096 + bytes. The total message length across all + containers will be limited to 12kb. Defaults + to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Deprecated. This field will be + removed in a future release. Indicate how + the termination message should be populated. + File will use the contents of terminationMessagePath + to populate the container status message on + both success and failure. FallbackToLogsOnError + will use the last chunk of container log output + if the termination message file is empty and + the container exited with an error. The log + output is limited to 2048 bytes or 80 lines, + whichever is smaller. Defaults to File. Cannot + be updated. + type: string + tty: + description: Deprecated. This field will be + removed in a future release. Whether this + container should allocate a DeprecatedTTY + for itself, also requires 'stdin' to be true. + Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block + devices to be used by the container. + items: + description: volumeDevice describes a mapping + of a raw block device within a container. + properties: + devicePath: + description: devicePath is the path inside + of the container that the device will + be mapped to. + type: string + name: + description: name must match the name + of a persistentVolumeClaim in the pod + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-type: atomic + volumeMounts: + description: Pod volumes to mount into the container's + filesystem. Cannot be updated. + items: + description: VolumeMount describes a mounting + of a Volume within a container. + properties: + mountPath: + description: Path within the container + at which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines + how mounts are propagated from the host + to container and the other way around. + When not set, MountPropagationNone is + used. This field is beta in 1.10. + type: string + name: + description: This must match the Name + of a Volume. + type: string + readOnly: + description: Mounted read-only if true, + read-write otherwise (false or unspecified). + Defaults to false. + type: boolean + subPath: + description: Path within the volume from + which the container's volume should + be mounted. Defaults to "" (volume's + root). + type: string + subPathExpr: + description: Expanded path within the + volume from which the container's volume + should be mounted. Behaves similarly + to SubPath but environment variable + references $(VAR_NAME) are expanded + using the container's environment. Defaults + to "" (volume's root). SubPathExpr and + SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-type: atomic + workingDir: + description: Container's working directory. + If not specified, the container runtime's + default will be used, which might be configured + in the container image. Cannot be updated. + type: string + required: + - name + type: object + steps: + description: Steps are the steps of the build; each + step is run sequentially with the source mounted + into /workspace. + items: + description: Step runs a subcomponent of a Task + properties: + args: + description: 'Arguments to the entrypoint. + The docker image''s CMD is used if this + is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. + If a variable cannot be resolved, the reference + in the input string will be unchanged. Double + $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal + "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + description: 'Entrypoint array. Not executed + within a shell. The docker image''s ENTRYPOINT + is used if this is not provided. Variable + references $(VAR_NAME) are expanded using + the container''s environment. If a variable + cannot be resolved, the reference in the + input string will be unchanged. Double $$ + are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal + "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable + exists or not. Cannot be updated. More info: + https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + description: List of environment variables + to set in the container. Cannot be updated. + items: + description: EnvVar represents an environment + variable present in a Container. + properties: + name: + description: Name of the environment + variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) + are expanded using the previously + defined environment variables in the + container and any service environment + variables. If a variable cannot be + resolved, the reference in the input + string will be unchanged. Double $$ + are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: + i.e. "$$(VAR_NAME)" will produce the + string literal "$(VAR_NAME)". Escaped + references will never be expanded, + regardless of whether the variable + exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment + variable's value. Cannot be used if + value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a + ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether + the ConfigMap or its key must + be defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of + the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, + status.hostIP, status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the + schema the FieldPath is written + in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field + to select in the specified + API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource + of the container: only resources + limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, + requests.cpu, requests.memory + and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: + required for volumes, optional + for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource + to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a + secret in the pod's namespace + properties: + key: + description: The key of the + secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether + the Secret or its key must + be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + envFrom: + description: List of sources to populate environment + variables in the container. The keys defined + within a source must be a C_IDENTIFIER. + All invalid keys will be reported as an + event when the container is starting. When + a key exists in multiple sources, the value + associated with the last source will take + precedence. Values defined by an Env with + a duplicate key will take precedence. Cannot + be updated. + items: + description: EnvFromSource represents the + source of a set of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select + from + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the + ConfigMap must be defined + type: boolean + type: object + prefix: + description: An optional identifier + to prepend to each key in the ConfigMap. + Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the + Secret must be defined + type: boolean + type: object + type: object + type: array + x-kubernetes-list-type: atomic + image: + description: 'Docker image name. More info: + https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level + config management to default or override + container images in workload controllers + like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, + Never, IfNotPresent. Defaults to Always + if :latest tag is specified, or IfNotPresent + otherwise. Cannot be updated. More info: + https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Deprecated. This field will be + removed in a future release. Actions that + the management system should take in response + to container lifecycle events. Cannot be + updated. + properties: + postStart: + 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' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the + command is root ('/') in the + container's filesystem. The + command is simply exec'd, it + is not run inside a shell, so + traditional shell instructions + ('|', etc) won't work. To use + a shell, you need to explicitly + call out to that shell. Exit + status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the + http request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. + You probably want to set "Host" + in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to + set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes + a custom header to be used + in HTTP probes + properties: + name: + description: The header + field name + type: string + value: + description: The header + field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on + the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for + connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket + is NOT supported as a LifecycleHandler + and kept for the backward compatibility. + There are no validation of this + field and lifecycle hooks will fail + in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the + pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + 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 Pod''s termination + grace period countdown begins before + the PreStop hook is executed. Regardless + of the outcome of the handler, the container + will eventually terminate within the + Pod''s termination grace period (unless + delayed by finalizers). 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' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the + command is root ('/') in the + container's filesystem. The + command is simply exec'd, it + is not run inside a shell, so + traditional shell instructions + ('|', etc) won't work. To use + a shell, you need to explicitly + call out to that shell. Exit + status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the + http request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. + You probably want to set "Host" + in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to + set in the request. HTTP allows + repeated headers. + items: + description: HTTPHeader describes + a custom header to be used + in HTTP probes + properties: + name: + description: The header + field name + type: string + value: + description: The header + field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on + the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for + connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: Deprecated. TCPSocket + is NOT supported as a LifecycleHandler + and kept for the backward compatibility. + There are no validation of this + field and lifecycle hooks will fail + in runtime when tcp handler is specified. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the + pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of + the port to access on the container. + Number must be in the range + 1 to 65535. Name must be an + IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Deprecated. This field will + be removed in a future release. Periodic + probe of container liveness. Container will + be restarted if the probe fails. Cannot + be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it + is not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to + 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action + involving a GRPC port. This is a beta + field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name + of the service to place in the gRPC + HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the + default behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to + perform the probe. Default to 10 seconds. + Minimum value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the pod + IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + name: + description: Name of the container specified + as a DNS_LABEL. Each container in a pod + must have a unique name (DNS_LABEL). Cannot + be updated. + type: string + onError: + description: OnError defines the exiting behavior + of a container on error can be set to [ + continue | stopAndFail ] stopAndFail indicates + exit the taskRun if the container exits + with non-zero exit code continue indicates + continue executing the rest of the steps + irrespective of the container exit code + type: string + ports: + description: Deprecated. This field will be + removed in a future release. List of ports + to expose from the container. Exposing a + port here gives the system additional information + about the network connections a container + uses, but is primarily informational. Not + specifying a port here DOES NOT prevent + that port from being exposed. Any port which + is listening on the default "0.0.0.0" address + inside a container will be accessible from + the network. Cannot be updated. + items: + description: ContainerPort represents a + network port in a single container. + properties: + containerPort: + description: Number of port to expose + on the pod's IP address. This must + be a valid port number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the + external port to. + type: string + hostPort: + description: Number of port to expose + on the host. If specified, this must + be a valid port number, 0 < x < 65536. + If HostNetwork is specified, this + must match ContainerPort. Most containers + do not need this. + format: int32 + type: integer + name: + description: If specified, this must + be an IANA_SVC_NAME and unique within + the pod. Each named port in a pod + must have a unique name. Name for + the port that can be referred to by + services. + type: string + protocol: + default: TCP + description: Protocol for port. Must + be UDP, TCP, or SCTP. Defaults to + "TCP". + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Deprecated. This field will + be removed in a future release. Periodic + probe of container service readiness. Container + will be removed from service endpoints if + the probe fails. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it + is not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to + 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action + involving a GRPC port. This is a beta + field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name + of the service to place in the gRPC + HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the + default behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to + perform the probe. Default to 10 seconds. + Minimum value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the pod + IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by + this container. Cannot be updated. More + info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum + amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum + amount of compute resources required. + If Requests is omitted for a container, + it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + script: + description: "Script is the contents of an + executable file to execute. \n If Script + is not empty, the Step cannot have an Command + and the Args will be passed to the Script." + type: string + securityContext: + description: 'SecurityContext defines the + security options the container should be + run with. If set, the fields of SecurityContext + override the equivalent fields of PodSecurityContext. + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation + controls whether a process can gain + more privileges than its parent process. + This bool directly controls if the no_new_privs + flag will be set on the container process. + AllowPrivilegeEscalation is true always + when the container is: 1) run as Privileged + 2) has CAP_SYS_ADMIN Note that this + field cannot be set when spec.os.name + is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop + when running containers. Defaults to + the default set of capabilities granted + by the container runtime. Note that + this field cannot be set when spec.os.name + is windows. + properties: + add: + description: Added capabilities + items: + description: Capability represent + POSIX capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent + POSIX capabilities type + type: string + type: array + type: object + privileged: + description: Run container in privileged + mode. Processes in privileged containers + are essentially equivalent to root on + the host. Defaults to false. Note that + this field cannot be set when spec.os.name + is windows. + type: boolean + procMount: + description: procMount denotes the type + of proc mount to use for the containers. + The default is DefaultProcMount which + uses the container runtime defaults + for readonly paths and masked paths. + This requires the ProcMountType feature + flag to be enabled. Note that this field + cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has + a read-only root filesystem. Default + is false. Note that this field cannot + be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint + of the container process. Uses runtime + default if unset. May also be set in + PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container + must run as a non-root user. If true, + the Kubelet will validate the image + at runtime to ensure that it does not + run as UID 0 (root) and fail to start + the container if it does. If unset or + false, no such validation will be performed. + May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint + of the container process. Defaults to + user specified in image metadata if + unspecified. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be + applied to the container. If unspecified, + the container runtime will allocate + a random SELinux context for each container. May + also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. Note that this field + cannot be set when spec.os.name is windows. + properties: + level: + description: Level is SELinux level + label that applies to the container. + type: string + role: + description: Role is a SELinux role + label that applies to the container. + type: string + type: + description: Type is a SELinux type + label that applies to the container. + type: string + user: + description: User is a SELinux user + label that applies to the container. + type: string + type: object + seccompProfile: + description: The seccomp options to use + by this container. If seccomp options + are provided at both the pod & container + level, the container options override + the pod options. Note that this field + cannot be set when spec.os.name is windows. + properties: + localhostProfile: + description: localhostProfile indicates + a profile defined in a file on the + node should be used. The profile + must be preconfigured on the node + to work. Must be a descending path, + relative to the kubelet's configured + seccomp profile location. Must only + be set if type is "Localhost". + type: string + type: + description: "type indicates which + kind of seccomp profile will be + applied. Valid options are: \n Localhost + - a profile defined in a file on + the node should be used. RuntimeDefault + - the container runtime default + profile should be used. Unconfined + - no profile should be applied." + type: string + required: + - type + type: object + windowsOptions: + description: The Windows specific settings + applied to all containers. If unspecified, + the options from the PodSecurityContext + will be used. If set in both SecurityContext + and PodSecurityContext, the value specified + in SecurityContext takes precedence. + Note that this field cannot be set when + spec.os.name is linux. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is + where the GMSA admission webhook + (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA + credential spec named by the GMSACredentialSpecName + field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName + is the name of the GMSA credential + spec to use. + type: string + hostProcess: + description: HostProcess determines + if a container should be run as + a 'Host Process' container. This + field is alpha-level and will only + be honored by components that enable + the WindowsHostProcessContainers + feature flag. Setting this field + without the feature flag will result + in errors when validating the Pod. + All of a Pod's containers must have + the same effective HostProcess value + (it is not allowed to have a mix + of HostProcess containers and non-HostProcess + containers). In addition, if HostProcess + is true then HostNetwork must also + be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows + to run the entrypoint of the container + process. Defaults to the user specified + in image metadata if unspecified. + May also be set in PodSecurityContext. + If set in both SecurityContext and + PodSecurityContext, the value specified + in SecurityContext takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'Deprecated. This field will + be removed in a future release. DeprecatedStartupProbe + indicates that the Pod has successfully + initialized. If specified, no other probes + are executed until this completes successfully. + If this probe fails, the Pod will be restarted, + just as if the livenessProbe failed. This + can be used to provide different probe parameters + at the beginning of a Pod''s lifecycle, + when it might take a long time to load data + or warm a cache, than during steady-state + operation. This cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: Exec specifies the action + to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it + is not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures + for the probe to be considered failed + after having succeeded. Defaults to + 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action + involving a GRPC port. This is a beta + field and requires enabling GRPCContainerProbe + feature gate. + properties: + port: + description: Port number of the gRPC + service. Number must be in the range + 1 to 65535. + format: int32 + type: integer + service: + description: "Service is the name + of the service to place in the gRPC + HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the + default behavior is defined by gRPC." + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect + to, defaults to the pod IP. You + probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set + in the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in + HTTP probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the + HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + 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' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to + perform the probe. Default to 10 seconds. + Minimum value is 1. + format: int32 + type: integer + 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. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action + involving a TCP port. + properties: + host: + description: 'Optional: Host name + to connect to, defaults to the pod + IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the + port to access on the container. + Number must be in the range 1 to + 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + 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. + format: int64 + type: integer + 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' + format: int32 + type: integer + type: object + stdin: + description: Deprecated. This field will be + removed in a future release. Whether this + container should allocate a buffer for stdin + in the container runtime. If this is not + set, reads from stdin in the container will + always result in EOF. Default is false. + type: boolean + stdinOnce: + description: Deprecated. This field will be + removed in a future release. Whether the + container runtime should close the stdin + channel after it has been opened by a single + attach. When stdin is true the stdin stream + will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin + is opened on container start, is empty until + the first client attaches to stdin, and + then remains open and accepts data until + the client disconnects, at which time stdin + is closed and remains closed until the container + is restarted. If this flag is false, a container + processes that reads from stdin will never + receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Deprecated. This field will + be removed in a future release. Optional: + Path at which the file to which the container''s + termination message will be written is mounted + into the container''s filesystem. Message + written is intended to be brief final status, + such as an assertion failure message. Will + be truncated by the node if greater than + 4096 bytes. The total message length across + all containers will be limited to 12kb. + Defaults to /dev/termination-log. Cannot + be updated.' + type: string + terminationMessagePolicy: + description: Deprecated. This field will be + removed in a future release. Indicate how + the termination message should be populated. + File will use the contents of terminationMessagePath + to populate the container status message + on both success and failure. FallbackToLogsOnError + will use the last chunk of container log + output if the termination message file is + empty and the container exited with an error. + The log output is limited to 2048 bytes + or 80 lines, whichever is smaller. Defaults + to File. Cannot be updated. + type: string + timeout: + description: 'Timeout is the time after which + the step times out. Defaults to never. Refer + to Go''s ParseDuration documentation for + expected format: https://golang.org/pkg/time/#ParseDuration' + type: string + tty: + description: Deprecated. This field will be + removed in a future release. Whether this + container should allocate a DeprecatedTTY + for itself, also requires 'stdin' to be + true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of + block devices to be used by the container. + items: + description: volumeDevice describes a mapping + of a raw block device within a container. + properties: + devicePath: + description: devicePath is the path + inside of the container that the device + will be mapped to. + type: string + name: + description: name must match the name + of a persistentVolumeClaim in the + pod + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-type: atomic + volumeMounts: + description: Pod volumes to mount into the + container's filesystem. Cannot be updated. + items: + description: VolumeMount describes a mounting + of a Volume within a container. + properties: + mountPath: + description: Path within the container + at which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines + how mounts are propagated from the + host to container and the other way + around. When not set, MountPropagationNone + is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name + of a Volume. + type: string + readOnly: + description: Mounted read-only if true, + read-write otherwise (false or unspecified). + Defaults to false. + type: boolean + subPath: + description: Path within the volume + from which the container's volume + should be mounted. Defaults to "" + (volume's root). + type: string + subPathExpr: + description: Expanded path within the + volume from which the container's + volume should be mounted. Behaves + similarly to SubPath but environment + variable references $(VAR_NAME) are + expanded using the container's environment. + Defaults to "" (volume's root). SubPathExpr + and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-type: atomic + workingDir: + description: Container's working directory. + If not specified, the container runtime's + default will be used, which might be configured + in the container image. Cannot be updated. + type: string + workspaces: + description: "This is an alpha field. You + must set the \"enable-api-fields\" feature + flag to \"alpha\" for this field to be supported. + \n Workspaces is a list of workspaces from + the Task that this Step wants exclusive + access to. Adding a workspace to this list + means that any other Step or Sidecar that + does not also request this Workspace will + not have access to it." + items: + description: WorkspaceUsage is used by a + Step or Sidecar to declare that it wants + isolated access to a Workspace defined + in a Task. + properties: + mountPath: + description: MountPath is the path that + the workspace should be mounted to + inside the Step or Sidecar, overriding + any MountPath specified in the Task's + WorkspaceDeclaration. + type: string + name: + description: Name is the name of the + workspace this Step or Sidecar wants + access to. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-type: atomic + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + volumes: + description: Volumes is a collection of volumes + that are available to mount into the steps of + the build. + items: + description: Volume represents a named volume + in a pod that may be accessed by any container + in the pod. + properties: + awsElasticBlockStore: + description: 'awsElasticBlockStore represents + an AWS Disk resource that is attached to + a kubelet''s host machine and then exposed + to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + properties: + fsType: + description: 'fsType is the filesystem + type of the volume that you want to + mount. Tip: Ensure that the filesystem + type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if + unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + TODO: how do we prevent errors in the + filesystem from compromising the machine' + type: string + partition: + description: 'partition is the partition + in the volume that you want to mount. + If omitted, the default is to mount + by volume name. Examples: For volume + /dev/sda1, you specify the partition + as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave + the property empty).' + format: int32 + type: integer + readOnly: + description: 'readOnly value true will + force the readOnly setting in VolumeMounts. + More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: boolean + volumeID: + description: 'volumeID is unique ID of + the persistent disk resource in AWS + (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: string + required: + - volumeID + type: object + azureDisk: + description: azureDisk represents an Azure + Data Disk mount on the host and bind mount + to the pod. + properties: + cachingMode: + description: 'cachingMode is the Host + Caching mode: None, Read Only, Read + Write.' + type: string + diskName: + description: diskName is the Name of the + data disk in the blob storage + type: string + diskURI: + description: diskURI is the URI of data + disk in the blob storage + type: string + fsType: + description: fsType is Filesystem type + to mount. Must be a filesystem type + supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: string + kind: + description: 'kind expected values are + Shared: multiple blob disks per storage + account Dedicated: single blob disk + per storage account Managed: azure + managed data disk (only in managed availability + set). defaults to shared' + type: string + readOnly: + description: readOnly Defaults to false + (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + description: azureFile represents an Azure + File Service mount on the host and bind + mount to the pod. + properties: + readOnly: + description: readOnly defaults to false + (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretName: + description: secretName is the name of + secret that contains Azure Storage Account + Name and Key + type: string + shareName: + description: shareName is the azure share + Name + type: string + required: + - secretName + - shareName + type: object + cephfs: + description: cephFS represents a Ceph FS mount + on the host that shares a pod's lifetime + properties: + monitors: + description: 'monitors is Required: Monitors + is a collection of Ceph monitors More + info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + items: + type: string + type: array + path: + description: 'path is Optional: Used as + the mounted root, rather than the full + Ceph tree, default is /' + type: string + readOnly: + description: 'readOnly is Optional: Defaults + to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: boolean + secretFile: + description: 'secretFile is Optional: + SecretFile is the path to key ring for + User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + secretRef: + description: 'secretRef is Optional: SecretRef + is reference to the authentication secret + for User, default is empty. More info: + https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + user: + description: 'user is optional: User is + the rados user name, default is admin + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + required: + - monitors + type: object + cinder: + description: 'cinder represents a cinder volume + attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + properties: + fsType: + description: 'fsType is the filesystem + type to mount. Must be a filesystem + type supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if + unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + readOnly: + description: 'readOnly defaults to false + (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: boolean + secretRef: + description: 'secretRef is optional: points + to a secret object containing parameters + used to connect to OpenStack.' + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + volumeID: + description: 'volumeID used to identify + the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + required: + - volumeID + type: object + configMap: + description: configMap represents a configMap + that should populate this volume + properties: + defaultMode: + description: 'defaultMode is optional: + mode bits used to set permissions on + created files by default. Must be an + octal value between 0000 and 0777 or + a decimal value between 0 and 511. YAML + accepts both octal and decimal values, + JSON requires decimal values for mode + bits. Defaults to 0644. Directories + within the path are not affected by + this setting. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + format: int32 + type: integer + items: + description: items if unspecified, each + key-value pair in the Data field of + the referenced ConfigMap will be projected + into the volume as a file whose name + is the key and content is the value. + If specified, the listed keys will be + projected into the specified paths, + and unlisted keys will not be present. + If a key is specified which is not present + in the ConfigMap, the volume setup will + error unless it is marked optional. + Paths must be relative and may not contain + the '..' path or start with '..'. + items: + description: Maps a string key to a + path within a volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: + mode bits used to set permissions + on this file. Must be an octal + value between 0000 and 0777 or + a decimal value between 0 and + 511. YAML accepts both octal and + decimal values, JSON requires + decimal values for mode bits. + If not specified, the volume defaultMode + will be used. This might be in + conflict with other options that + affect the file mode, like fsGroup, + and the result can be other mode + bits set.' + format: int32 + type: integer + path: + description: path is the relative + path of the file to map the key + to. May not be an absolute path. + May not contain the path element + '..'. May not start with the string + '..'. + type: string + required: + - key + - path + type: object + type: array + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: optional specify whether + the ConfigMap or its keys must be defined + type: boolean + type: object + csi: + description: csi (Container Storage Interface) + represents ephemeral storage that is handled + by certain external CSI drivers (Beta feature). + properties: + driver: + description: driver is the name of the + CSI driver that handles this volume. + Consult with your admin for the correct + name as registered in the cluster. + type: string + fsType: + description: fsType to mount. Ex. "ext4", + "xfs", "ntfs". If not provided, the + empty value is passed to the associated + CSI driver which will determine the + default filesystem to apply. + type: string + nodePublishSecretRef: + description: nodePublishSecretRef is a + reference to the secret object containing + sensitive information to pass to the + CSI driver to complete the CSI NodePublishVolume + and NodeUnpublishVolume calls. This + field is optional, and may be empty + if no secret is required. If the secret + object contains more than one secret, + all secret references are passed. + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + readOnly: + description: readOnly specifies a read-only + configuration for the volume. Defaults + to false (read/write). + type: boolean + volumeAttributes: + additionalProperties: + type: string + description: volumeAttributes stores driver-specific + properties that are passed to the CSI + driver. Consult your driver's documentation + for supported values. + type: object + required: + - driver + type: object + downwardAPI: + description: downwardAPI represents downward + API about the pod that should populate this + volume + properties: + defaultMode: + description: 'Optional: mode bits to use + on created files by default. Must be + a Optional: mode bits used to set permissions + on created files by default. Must be + an octal value between 0000 and 0777 + or a decimal value between 0 and 511. + YAML accepts both octal and decimal + values, JSON requires decimal values + for mode bits. Defaults to 0644. Directories + within the path are not affected by + this setting. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + format: int32 + type: integer + items: + description: Items is a list of downward + API volume file + items: + description: DownwardAPIVolumeFile represents + information to create the file containing + the pod field + properties: + fieldRef: + description: 'Required: Selects + a field of the pod: only annotations, + labels, name and namespace are + supported.' + properties: + apiVersion: + description: Version of the + schema the FieldPath is written + in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field + to select in the specified + API version. + type: string + required: + - fieldPath + type: object + mode: + description: 'Optional: mode bits + used to set permissions on this + file, must be an octal value between + 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts + both octal and decimal values, + JSON requires decimal values for + mode bits. If not specified, the + volume defaultMode will be used. + This might be in conflict with + other options that affect the + file mode, like fsGroup, and the + result can be other mode bits + set.' + format: int32 + type: integer + path: + description: 'Required: Path is the + relative path name of the file + to be created. Must not be absolute + or contain the ''..'' path. Must + be utf-8 encoded. The first item + of the relative path must not + start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource + of the container: only resources + limits and requests (limits.cpu, + limits.memory, requests.cpu and + requests.memory) are currently + supported.' + properties: + containerName: + description: 'Container name: + required for volumes, optional + for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource + to select' + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + emptyDir: + description: 'emptyDir represents a temporary + directory that shares a pod''s lifetime. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + properties: + medium: + description: 'medium represents what type + of storage medium should back this directory. + The default is "" which means to use + the node''s default medium. Must be + an empty string (default) or Memory. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + description: 'sizeLimit is the total amount + of local storage required for this EmptyDir + volume. The size limit is also applicable + for memory medium. The maximum usage + on memory medium EmptyDir would be the + minimum value between the SizeLimit + specified here and the sum of memory + limits of all containers in a pod. The + default is nil which means that the + limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + description: "ephemeral represents a volume + that is handled by a cluster storage driver. + The volume's lifecycle is tied to the pod + that defines it - it will be created before + the pod starts, and deleted when the pod + is removed. \n Use this if: a) the volume + is only needed while the pod runs, b) features + of normal volumes like restoring from snapshot + or capacity tracking are needed, c) the + storage driver is specified through a storage + class, and d) the storage driver supports + dynamic volume provisioning through a + PersistentVolumeClaim (see EphemeralVolumeSource + for more information on the connection + between this volume type and PersistentVolumeClaim). + \n Use PersistentVolumeClaim or one of the + vendor-specific APIs for volumes that persist + for longer than the lifecycle of an individual + pod. \n Use CSI for light-weight local ephemeral + volumes if the CSI driver is meant to be + used that way - see the documentation of + the driver for more information. \n A pod + can use both types of ephemeral volumes + and persistent volumes at the same time." + properties: + volumeClaimTemplate: + description: "Will be used to create a + stand-alone PVC to provision the volume. + The pod in which this EphemeralVolumeSource + is embedded will be the owner of the + PVC, i.e. the PVC will be deleted together + with the pod. The name of the PVC will + be `-` where + `` is the name from the + `PodSpec.Volumes` array entry. Pod validation + will reject the pod if the concatenated + name is not valid for a PVC (for example, + too long). \n An existing PVC with that + name that is not owned by the pod will + *not* be used for the pod to avoid using + an unrelated volume by mistake. Starting + the pod is then blocked until the unrelated + PVC is removed. If such a pre-created + PVC is meant to be used by the pod, + the PVC has to updated with an owner + reference to the pod once the pod exists. + Normally this should not be necessary, + but it may be useful when manually reconstructing + a broken cluster. \n This field is read-only + and no changes will be made by Kubernetes + to the PVC after it has been created. + \n Required, must not be nil." + properties: + metadata: + description: May contain labels and + annotations that will be copied + into the PVC when creating it. No + other fields are allowed and will + be rejected during validation. + type: object + spec: + description: The specification for + the PersistentVolumeClaim. The entire + content is copied unchanged into + the PVC that gets created from this + template. The same fields as in + a PersistentVolumeClaim are also + valid here. + properties: + accessModes: + description: 'accessModes contains + the desired access modes the + volume should have. More info: + https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + items: + type: string + type: array + dataSource: + description: 'dataSource field + can be used to specify either: + * An existing VolumeSnapshot + object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external + controller can support the specified + data source, it will create + a new volume based on the contents + of the specified data source. + If the AnyVolumeDataSource feature + gate is enabled, this field + will always have the same contents + as the DataSourceRef field.' + properties: + apiGroup: + description: APIGroup is the + group for the resource being + referenced. If APIGroup + is not specified, the specified + Kind must be in the core + API group. For any other + third-party types, APIGroup + is required. + type: string + kind: + description: Kind is the type + of resource being referenced + type: string + name: + description: Name is the name + of resource being referenced + type: string + required: + - kind + - name + type: object + dataSourceRef: + description: 'dataSourceRef specifies + the object from which to populate + the volume with data, if a non-empty + volume is desired. This may + be any local object from a non-empty + API group (non core object) + or a PersistentVolumeClaim object. + When this field is specified, + volume binding will only succeed + if the type of the specified + object matches some installed + volume populator or dynamic + provisioner. This field will + replace the functionality of + the DataSource field and as + such if both fields are non-empty, + they must have the same value. + For backwards compatibility, + both fields (DataSource and + DataSourceRef) will be set to + the same value automatically + if one of them is empty and + the other is non-empty. There + are two important differences + between DataSource and DataSourceRef: + * While DataSource only allows + two specific types of objects, + DataSourceRef allows any non-core + object, as well as PersistentVolumeClaim + objects. * While DataSource + ignores disallowed values (dropping + them), DataSourceRef preserves + all values, and generates an + error if a disallowed value + is specified. (Beta) Using + this field requires the AnyVolumeDataSource + feature gate to be enabled.' + properties: + apiGroup: + description: APIGroup is the + group for the resource being + referenced. If APIGroup + is not specified, the specified + Kind must be in the core + API group. For any other + third-party types, APIGroup + is required. + type: string + kind: + description: Kind is the type + of resource being referenced + type: string + name: + description: Name is the name + of resource being referenced + type: string + required: + - kind + - name + type: object + resources: + description: 'resources represents + the minimum resources the volume + should have. If RecoverVolumeExpansionFailure + feature is enabled users are + allowed to specify resource + requirements that are lower + than previous value but must + still be higher than capacity + recorded in the status field + of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes + the maximum amount of compute + resources allowed. More + info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes + the minimum amount of compute + resources required. If Requests + is omitted for a container, + it defaults to Limits if + that is explicitly specified, + otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + selector: + description: selector is a label + query over volumes to consider + for binding. + properties: + matchExpressions: + description: matchExpressions + is a list of label selector + requirements. The requirements + are ANDed. + items: + description: A label selector + requirement is a selector + that contains values, + a key, and an operator + that relates the key and + values. + properties: + key: + description: key is + the label key that + the selector applies + to. + type: string + operator: + description: operator + represents a key's + relationship to a + set of values. Valid + operators are In, + NotIn, Exists and + DoesNotExist. + type: string + values: + description: values + is an array of string + values. If the operator + is In or NotIn, the + values array must + be non-empty. If the + operator is Exists + or DoesNotExist, the + values array must + be empty. This array + is replaced during + a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is + a map of {key,value} pairs. + A single {key,value} in + the matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", + the operator is "In", and + the values array contains + only "value". The requirements + are ANDed. + type: object + type: object + storageClassName: + description: 'storageClassName + is the name of the StorageClass + required by the claim. More + info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + volumeMode: + description: volumeMode defines + what type of volume is required + by the claim. Value of Filesystem + is implied when not included + in claim spec. + type: string + volumeName: + description: volumeName is the + binding reference to the PersistentVolume + backing this claim. + type: string + type: object + required: + - spec + type: object + type: object + fc: + description: fc represents a Fibre Channel + resource that is attached to a kubelet's + host machine and then exposed to the pod. + properties: + fsType: + description: 'fsType is the filesystem + type to mount. Must be a filesystem + type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + TODO: how do we prevent errors in the + filesystem from compromising the machine' + type: string + lun: + description: 'lun is Optional: FC target + lun number' + format: int32 + type: integer + readOnly: + description: 'readOnly is Optional: Defaults + to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: boolean + targetWWNs: + description: 'targetWWNs is Optional: + FC target worldwide names (WWNs)' + items: + type: string + type: array + wwids: + description: 'wwids Optional: FC volume + world wide identifiers (wwids) Either + wwids or combination of targetWWNs and + lun must be set, but not both simultaneously.' + items: + type: string + type: array + type: object + flexVolume: + description: flexVolume represents a generic + volume resource that is provisioned/attached + using an exec based plugin. + properties: + driver: + description: driver is the name of the + driver to use for this volume. + type: string + fsType: + description: fsType is the filesystem + type to mount. Must be a filesystem + type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". The + default filesystem depends on FlexVolume + script. + type: string + options: + additionalProperties: + type: string + description: 'options is Optional: this + field holds extra command options if + any.' + type: object + readOnly: + description: 'readOnly is Optional: defaults + to false (read/write). ReadOnly here + will force the ReadOnly setting in VolumeMounts.' + type: boolean + secretRef: + description: 'secretRef is Optional: secretRef + is reference to the secret object containing + sensitive information to pass to the + plugin scripts. This may be empty if + no secret object is specified. If the + secret object contains more than one + secret, all secrets are passed to the + plugin scripts.' + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + required: + - driver + type: object + flocker: + description: flocker represents a Flocker + volume attached to a kubelet's host machine. + This depends on the Flocker control service + being running + properties: + datasetName: + description: datasetName is Name of the + dataset stored as metadata -> name on + the dataset for Flocker should be considered + as deprecated + type: string + datasetUUID: + description: datasetUUID is the UUID of + the dataset. This is unique identifier + of a Flocker dataset + type: string + type: object + gcePersistentDisk: + description: 'gcePersistentDisk represents + a GCE Disk resource that is attached to + a kubelet''s host machine and then exposed + to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + properties: + fsType: + description: 'fsType is filesystem type + of the volume that you want to mount. + Tip: Ensure that the filesystem type + is supported by the host operating system. + Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + TODO: how do we prevent errors in the + filesystem from compromising the machine' + type: string + partition: + description: 'partition is the partition + in the volume that you want to mount. + If omitted, the default is to mount + by volume name. Examples: For volume + /dev/sda1, you specify the partition + as "1". Similarly, the volume partition + for /dev/sda is "0" (or you can leave + the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + format: int32 + type: integer + pdName: + description: 'pdName is unique name of + the PD resource in GCE. Used to identify + the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: string + readOnly: + description: 'readOnly here will force + the ReadOnly setting in VolumeMounts. + Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: boolean + required: + - pdName + type: object + gitRepo: + description: 'gitRepo represents a git repository + at a particular revision. DEPRECATED: GitRepo + is deprecated. To provision a container + with a git repo, mount an EmptyDir into + an InitContainer that clones the repo using + git, then mount the EmptyDir into the Pod''s + container.' + properties: + directory: + description: directory is the target directory + name. Must not contain or start with + '..'. If '.' is supplied, the volume + directory will be the git repository. Otherwise, + if specified, the volume will contain + the git repository in the subdirectory + with the given name. + type: string + repository: + description: repository is the URL + type: string + revision: + description: revision is the commit hash + for the specified revision. + type: string + required: + - repository + type: object + glusterfs: + description: 'glusterfs represents a Glusterfs + mount on the host that shares a pod''s lifetime. + More info: https://examples.k8s.io/volumes/glusterfs/README.md' + properties: + endpoints: + description: 'endpoints is the endpoint + name that details Glusterfs topology. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + path: + description: 'path is the Glusterfs volume + path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + readOnly: + description: 'readOnly here will force + the Glusterfs volume to be mounted with + read-only permissions. Defaults to false. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: boolean + required: + - endpoints + - path + type: object + hostPath: + description: 'hostPath represents a pre-existing + file or directory on the host machine that + is directly exposed to the container. This + is generally used for system agents or other + privileged things that are allowed to see + the host machine. Most containers will NOT + need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + --- TODO(jonesdl) We need to restrict who + can use host directory mounts and who can/can + not mount host directories as read/write.' + properties: + path: + description: 'path of the directory on + the host. If the path is a symlink, + it will follow the link to the real + path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + type: + description: 'type for HostPath Volume + Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + required: + - path + type: object + iscsi: + description: 'iscsi represents an ISCSI Disk + resource that is attached to a kubelet''s + host machine and then exposed to the pod. + More info: https://examples.k8s.io/volumes/iscsi/README.md' + properties: + chapAuthDiscovery: + description: chapAuthDiscovery defines + whether support iSCSI Discovery CHAP + authentication + type: boolean + chapAuthSession: + description: chapAuthSession defines whether + support iSCSI Session CHAP authentication + type: boolean + fsType: + description: 'fsType is the filesystem + type of the volume that you want to + mount. Tip: Ensure that the filesystem + type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if + unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi + TODO: how do we prevent errors in the + filesystem from compromising the machine' + type: string + initiatorName: + description: initiatorName is the custom + iSCSI Initiator Name. If initiatorName + is specified with iscsiInterface simultaneously, + new iSCSI interface : will be created for the connection. + type: string + iqn: + description: iqn is the target iSCSI Qualified + Name. + type: string + iscsiInterface: + description: iscsiInterface is the interface + Name that uses an iSCSI transport. Defaults + to 'default' (tcp). + type: string + lun: + description: lun represents iSCSI Target + Lun number. + format: int32 + type: integer + portals: + description: portals is the iSCSI Target + Portal List. The portal is either an + IP or ip_addr:port if the port is other + than default (typically TCP ports 860 + and 3260). + items: + type: string + type: array + readOnly: + description: readOnly here will force + the ReadOnly setting in VolumeMounts. + Defaults to false. + type: boolean + secretRef: + description: secretRef is the CHAP Secret + for iSCSI target and initiator authentication + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + targetPortal: + description: targetPortal is iSCSI Target + Portal. The Portal is either an IP or + ip_addr:port if the port is other than + default (typically TCP ports 860 and + 3260). + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + description: 'name of the volume. Must be + a DNS_LABEL and unique within the pod. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + nfs: + description: 'nfs represents an NFS mount + on the host that shares a pod''s lifetime + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + properties: + path: + description: 'path that is exported by + the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + readOnly: + description: 'readOnly here will force + the NFS export to be mounted with read-only + permissions. Defaults to false. More + info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: boolean + server: + description: 'server is the hostname or + IP address of the NFS server. More info: + https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + description: 'persistentVolumeClaimVolumeSource + represents a reference to a PersistentVolumeClaim + in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + properties: + claimName: + description: 'claimName is the name of + a PersistentVolumeClaim in the same + namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: string + readOnly: + description: readOnly Will force the ReadOnly + setting in VolumeMounts. Default false. + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + description: photonPersistentDisk represents + a PhotonController persistent disk attached + and mounted on kubelets host machine + properties: + fsType: + description: fsType is the filesystem + type to mount. Must be a filesystem + type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: string + pdID: + description: pdID is the ID that identifies + Photon Controller persistent disk + type: string + required: + - pdID + type: object + portworxVolume: + description: portworxVolume represents a portworx + volume attached and mounted on kubelets + host machine + properties: + fsType: + description: fSType represents the filesystem + type to mount Must be a filesystem type + supported by the host operating system. + Ex. "ext4", "xfs". Implicitly inferred + to be "ext4" if unspecified. + type: string + readOnly: + description: readOnly defaults to false + (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + volumeID: + description: volumeID uniquely identifies + a Portworx volume + type: string + required: + - volumeID + type: object + projected: + description: projected items for all in one + resources secrets, configmaps, and downward + API + properties: + defaultMode: + description: defaultMode are the mode + bits used to set permissions on created + files by default. Must be an octal value + between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both + octal and decimal values, JSON requires + decimal values for mode bits. Directories + within the path are not affected by + this setting. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set. + format: int32 + type: integer + sources: + description: sources is the list of volume + projections + items: + description: Projection that may be + projected along with other supported + volume types + properties: + configMap: + description: configMap information + about the configMap data to project + properties: + items: + description: items if unspecified, + each key-value pair in the + Data field of the referenced + ConfigMap will be projected + into the volume as a file + whose name is the key and + content is the value. If specified, + the listed keys will be projected + into the specified paths, + and unlisted keys will not + be present. If a key is specified + which is not present in the + ConfigMap, the volume setup + will error unless it is marked + optional. Paths must be relative + and may not contain the '..' + path or start with '..'. + items: + description: Maps a string + key to a path within a volume. + properties: + key: + description: key is the + key to project. + type: string + mode: + description: 'mode is + Optional: mode bits + used to set permissions + on this file. Must be + an octal value between + 0000 and 0777 or a decimal + value between 0 and + 511. YAML accepts both + octal and decimal values, + JSON requires decimal + values for mode bits. + If not specified, the + volume defaultMode will + be used. This might + be in conflict with + other options that affect + the file mode, like + fsGroup, and the result + can be other mode bits + set.' + format: int32 + type: integer + path: + description: path is the + relative path of the + file to map the key + to. May not be an absolute + path. May not contain + the path element '..'. + May not start with the + string '..'. + type: string + required: + - key + - path + type: object + type: array + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: optional specify + whether the ConfigMap or its + keys must be defined + type: boolean + type: object + downwardAPI: + description: downwardAPI information + about the downwardAPI data to + project + properties: + items: + description: Items is a list + of DownwardAPIVolume file + items: + description: DownwardAPIVolumeFile + represents information to + create the file containing + the pod field + properties: + fieldRef: + description: 'Required: + Selects a field of the + pod: only annotations, + labels, name and namespace + are supported.' + properties: + apiVersion: + description: Version + of the schema the + FieldPath is written + in terms of, defaults + to "v1". + type: string + fieldPath: + description: Path + of the field to + select in the specified + API version. + type: string + required: + - fieldPath + type: object + mode: + description: 'Optional: + mode bits used to set + permissions on this + file, must be an octal + value between 0000 and + 0777 or a decimal value + between 0 and 511. YAML + accepts both octal and + decimal values, JSON + requires decimal values + for mode bits. If not + specified, the volume + defaultMode will be + used. This might be + in conflict with other + options that affect + the file mode, like + fsGroup, and the result + can be other mode bits + set.' + format: int32 + type: integer + path: + description: 'Required: + Path is the relative + path name of the file + to be created. Must + not be absolute or contain + the ''..'' path. Must + be utf-8 encoded. The + first item of the relative + path must not start + with ''..''' + type: string + resourceFieldRef: + description: 'Selects + a resource of the container: + only resources limits + and requests (limits.cpu, + limits.memory, requests.cpu + and requests.memory) + are currently supported.' + properties: + containerName: + description: 'Container + name: required for + volumes, optional + for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies + the output format + of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: + resource to select' + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + secret: + description: secret information + about the secret data to project + properties: + items: + description: items if unspecified, + each key-value pair in the + Data field of the referenced + Secret will be projected into + the volume as a file whose + name is the key and content + is the value. If specified, + the listed keys will be projected + into the specified paths, + and unlisted keys will not + be present. If a key is specified + which is not present in the + Secret, the volume setup will + error unless it is marked + optional. Paths must be relative + and may not contain the '..' + path or start with '..'. + items: + description: Maps a string + key to a path within a volume. + properties: + key: + description: key is the + key to project. + type: string + mode: + description: 'mode is + Optional: mode bits + used to set permissions + on this file. Must be + an octal value between + 0000 and 0777 or a decimal + value between 0 and + 511. YAML accepts both + octal and decimal values, + JSON requires decimal + values for mode bits. + If not specified, the + volume defaultMode will + be used. This might + be in conflict with + other options that affect + the file mode, like + fsGroup, and the result + can be other mode bits + set.' + format: int32 + type: integer + path: + description: path is the + relative path of the + file to map the key + to. May not be an absolute + path. May not contain + the path element '..'. + May not start with the + string '..'. + type: string + required: + - key + - path + type: object + type: array + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. + apiVersion, kind, uid?' + type: string + optional: + description: optional field + specify whether the Secret + or its key must be defined + type: boolean + type: object + serviceAccountToken: + description: serviceAccountToken + is information about the serviceAccountToken + data to project + properties: + audience: + description: audience is the + intended audience of the token. + A recipient of a token must + identify itself with an identifier + specified in the audience + of the token, and otherwise + should reject the token. The + audience defaults to the identifier + of the apiserver. + type: string + expirationSeconds: + description: expirationSeconds + is the requested duration + of validity of the service + account token. As the token + approaches expiration, the + kubelet volume plugin will + proactively rotate the service + account token. The kubelet + will start trying to rotate + the token if the token is + older than 80 percent of its + time to live or if the token + is older than 24 hours.Defaults + to 1 hour and must be at least + 10 minutes. + format: int64 + type: integer + path: + description: path is the path + relative to the mount point + of the file to project the + token into. + type: string + required: + - path + type: object + type: object + type: array + type: object + quobyte: + description: quobyte represents a Quobyte + mount on the host that shares a pod's lifetime + properties: + group: + description: group to map volume access + to Default is no group + type: string + readOnly: + description: readOnly here will force + the Quobyte volume to be mounted with + read-only permissions. Defaults to false. + type: boolean + registry: + description: registry represents a single + or multiple Quobyte Registry services + specified as a string as host:port pair + (multiple entries are separated with + commas) which acts as the central registry + for volumes + type: string + tenant: + description: tenant owning the given Quobyte + volume in the Backend Used with dynamically + provisioned Quobyte volumes, value is + set by the plugin + type: string + user: + description: user to map volume access + to Defaults to serivceaccount user + type: string + volume: + description: volume is a string that references + an already created Quobyte volume by + name. + type: string + required: + - registry + - volume + type: object + rbd: + description: 'rbd represents a Rados Block + Device mount on the host that shares a pod''s + lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + properties: + fsType: + description: 'fsType is the filesystem + type of the volume that you want to + mount. Tip: Ensure that the filesystem + type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if + unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd + TODO: how do we prevent errors in the + filesystem from compromising the machine' + type: string + image: + description: 'image is the rados image + name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + keyring: + description: 'keyring is the path to key + ring for RBDUser. Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + monitors: + description: 'monitors is a collection + of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + items: + type: string + type: array + pool: + description: 'pool is the rados pool name. + Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + readOnly: + description: 'readOnly here will force + the ReadOnly setting in VolumeMounts. + Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: boolean + secretRef: + description: 'secretRef is name of the + authentication secret for RBDUser. If + provided overrides keyring. Default + is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + user: + description: 'user is the rados user name. + Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + required: + - image + - monitors + type: object + scaleIO: + description: scaleIO represents a ScaleIO + persistent volume attached and mounted on + Kubernetes nodes. + properties: + fsType: + description: fsType is the filesystem + type to mount. Must be a filesystem + type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Default + is "xfs". + type: string + gateway: + description: gateway is the host address + of the ScaleIO API Gateway. + type: string + protectionDomain: + description: protectionDomain is the name + of the ScaleIO Protection Domain for + the configured storage. + type: string + readOnly: + description: readOnly Defaults to false + (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: secretRef references to the + secret for ScaleIO user and other sensitive + information. If this is not provided, + Login operation will fail. + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + sslEnabled: + description: sslEnabled Flag enable/disable + SSL communication with Gateway, default + false + type: boolean + storageMode: + description: storageMode indicates whether + the storage for a volume should be ThickProvisioned + or ThinProvisioned. Default is ThinProvisioned. + type: string + storagePool: + description: storagePool is the ScaleIO + Storage Pool associated with the protection + domain. + type: string + system: + description: system is the name of the + storage system as configured in ScaleIO. + type: string + volumeName: + description: volumeName is the name of + a volume already created in the ScaleIO + system that is associated with this + volume source. + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + description: 'secret represents a secret that + should populate this volume. More info: + https://kubernetes.io/docs/concepts/storage/volumes#secret' + properties: + defaultMode: + description: 'defaultMode is Optional: + mode bits used to set permissions on + created files by default. Must be an + octal value between 0000 and 0777 or + a decimal value between 0 and 511. YAML + accepts both octal and decimal values, + JSON requires decimal values for mode + bits. Defaults to 0644. Directories + within the path are not affected by + this setting. This might be in conflict + with other options that affect the file + mode, like fsGroup, and the result can + be other mode bits set.' + format: int32 + type: integer + items: + description: items If unspecified, each + key-value pair in the Data field of + the referenced Secret will be projected + into the volume as a file whose name + is the key and content is the value. + If specified, the listed keys will be + projected into the specified paths, + and unlisted keys will not be present. + If a key is specified which is not present + in the Secret, the volume setup will + error unless it is marked optional. + Paths must be relative and may not contain + the '..' path or start with '..'. + items: + description: Maps a string key to a + path within a volume. + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: + mode bits used to set permissions + on this file. Must be an octal + value between 0000 and 0777 or + a decimal value between 0 and + 511. YAML accepts both octal and + decimal values, JSON requires + decimal values for mode bits. + If not specified, the volume defaultMode + will be used. This might be in + conflict with other options that + affect the file mode, like fsGroup, + and the result can be other mode + bits set.' + format: int32 + type: integer + path: + description: path is the relative + path of the file to map the key + to. May not be an absolute path. + May not contain the path element + '..'. May not start with the string + '..'. + type: string + required: + - key + - path + type: object + type: array + optional: + description: optional field specify whether + the Secret or its keys must be defined + type: boolean + secretName: + description: 'secretName is the name of + the secret in the pod''s namespace to + use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + type: string + type: object + storageos: + description: storageOS represents a StorageOS + volume attached and mounted on Kubernetes + nodes. + properties: + fsType: + description: fsType is the filesystem + type to mount. Must be a filesystem + type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: string + readOnly: + description: readOnly defaults to false + (read/write). ReadOnly here will force + the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: secretRef specifies the secret + to use for obtaining the StorageOS API + credentials. If not specified, default + values will be attempted. + properties: + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + volumeName: + description: volumeName is the human-readable + name of the StorageOS volume. Volume + names are only unique within a namespace. + type: string + volumeNamespace: + description: volumeNamespace specifies + the scope of the volume within StorageOS. If + no namespace is specified then the Pod's + namespace will be used. This allows + the Kubernetes name scoping to be mirrored + within StorageOS for tighter integration. + Set VolumeName to any name to override + the default behaviour. Set to "default" + if you are not using namespaces within + StorageOS. Namespaces that do not pre-exist + within StorageOS will be created. + type: string + type: object + vsphereVolume: + description: vsphereVolume represents a vSphere + volume attached and mounted on kubelets + host machine + properties: + fsType: + description: fsType is filesystem type + to mount. Must be a filesystem type + supported by the host operating system. + Ex. "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. + type: string + storagePolicyID: + description: storagePolicyID is the storage + Policy Based Management (SPBM) profile + ID associated with the StoragePolicyName. + type: string + storagePolicyName: + description: storagePolicyName is the + storage Policy Based Management (SPBM) + profile name. + type: string + volumePath: + description: volumePath is the path that + identifies vSphere volume vmdk + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + workspaces: + description: Workspaces are the volumes that this + Task requires. + items: + description: WorkspaceDeclaration is a declaration + of a volume that a Task requires. + properties: + description: + description: Description is an optional human + readable description of this volume. + type: string + mountPath: + description: MountPath overrides the directory + that the volume will be made available at. + type: string + name: + description: Name is the name by which you + can bind the volume at runtime. + type: string + optional: + description: Optional marks a Workspace as + not being required in TaskRuns. By default + this field is false and so declared workspaces + are required. + type: boolean + readOnly: + description: ReadOnly dictates whether a mounted + volume is writable. By default this field + is false and so mounted volumes are writable. + type: boolean + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + type: object + timeout: + description: 'Time after which the TaskRun times out. + Defaults to 1 hour. Specified TaskRun timeout should + be less than 24h. Refer Go''s ParseDuration documentation + for expected format: https://golang.org/pkg/time/#ParseDuration' + type: string + when: + description: WhenExpressions is a list of when expressions + that need to be true for the task to run + items: + description: WhenExpression allows a PipelineTask + to declare expressions to be evaluated before the + Task is run to determine whether the Task should + be executed or skipped + properties: + input: + description: Input is the string for guard checking + which can be a static input or an output from + a parent Task + type: string + operator: + description: Operator that represents an Input's + relationship to the values + type: string + values: + description: Values is an array of strings, which + is compared against the input, for guard checking + It must be non-empty + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - input + - operator + - values + type: object + type: array + workspaces: + description: Workspaces maps workspaces from the pipeline + spec to the workspaces declared in the Task. + items: + description: WorkspacePipelineTaskBinding describes + how a workspace passed into the pipeline should + be mapped to a task's declared workspace. + properties: + name: + description: Name is the name of the workspace + as declared by the task + type: string + subPath: + description: SubPath is optionally a directory + on the volume which should be used for this + binding (i.e. the volume will be mounted at + this sub directory). + type: string + workspace: + description: Workspace is the name of the workspace + declared by the pipeline + type: string + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + type: object + type: array + x-kubernetes-list-type: atomic params: description: Params declares a list of input parameters that must be supplied when this Pipeline is run. @@ -702,6 +7742,7 @@ spec: - name type: object type: array + x-kubernetes-list-type: atomic resources: description: Resources declares the names and types of the resources given to the Pipeline's tasks as inputs and outputs. @@ -733,6 +7774,7 @@ spec: - type type: object type: array + x-kubernetes-list-type: atomic results: description: Results are values that this pipeline can output once run @@ -756,6 +7798,7 @@ spec: - value type: object type: array + x-kubernetes-list-type: atomic tasks: description: Tasks declares the graph of Tasks that execute when this Pipeline is run. @@ -766,7 +7809,8 @@ spec: properties: conditions: description: Conditions is a list of conditions that - need to be true for the task to run + need to be true for the task to run Conditions are + deprecated, use WhenExpressions instead items: description: PipelineTaskCondition allows a PipelineTask to declare a Condition to be evaluated before the @@ -860,9 +7904,58 @@ spec: type: array x-kubernetes-list-type: atomic required: - - conditionRef + - conditionRef + type: object + type: array + x-kubernetes-list-type: atomic + matrix: + description: Matrix declares parameters used to fan + out this task. + items: + description: Param declares an ArrayOrString to use + for the parameter called name. + properties: + name: + type: string + value: + description: 'ArrayOrString is a type that can + hold a single string or string array. Used in + JSON unmarshalling so that a single JSON field + can accept either an individual string or an + array of strings. TODO (@chuangw6): This struct + will be renamed or be embedded in a new struct + to take into consideration the object case after + the community reaches an agreement on it.' + properties: + arrayVal: + items: + type: string + type: array + x-kubernetes-list-type: atomic + objectVal: + additionalProperties: + type: string + type: object + stringVal: + type: string + type: + description: ParamType indicates the type + of an input parameter; Used to distinguish + between a single string and an array of + strings. + type: string + required: + - arrayVal + - objectVal + - stringVal + - type + type: object + required: + - name + - value type: object type: array + x-kubernetes-list-type: atomic name: description: Name is the name of this task within the context of a Pipeline. Name is used as a coordinate @@ -916,6 +8009,7 @@ spec: - value type: object type: array + x-kubernetes-list-type: atomic resources: description: Resources declares the resources given to this task as inputs and outputs. @@ -991,6 +8085,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: atomic taskRef: description: TaskRef is a reference to a task definition. properties: @@ -1039,222 +8134,28 @@ spec: x-kubernetes-list-type: atomic type: object taskSpec: - description: TaskSpec is specification of a task + description: TaskSpec is a specification of a task properties: + apiVersion: + type: string description: description: Description is a user-facing description of the task that may be used to populate a UI. type: string - inputs: - description: Inputs is an optional set of parameters - and resources which must be supplied by the user - when a Task is executed by a TaskRun. - properties: - params: - description: Params is a list of input parameters - required to run the task. Params must be supplied - as inputs in TaskRuns unless they declare - a default value. - items: - description: ParamSpec defines arbitrary parameters - needed beyond typed inputs (such as resources). - Parameter values are provided by users as - inputs on a TaskRun or PipelineRun. - properties: - default: - description: Default is the value a parameter - takes if no input value is supplied. - If default is set, a Task may be executed - without a supplied value for the parameter. - properties: - arrayVal: - items: - type: string - type: array - x-kubernetes-list-type: atomic - objectVal: - additionalProperties: - type: string - type: object - stringVal: - type: string - type: - description: ParamType indicates the - type of an input parameter; Used - to distinguish between a single - string and an array of strings. - type: string - required: - - arrayVal - - objectVal - - stringVal - - type - type: object - description: - description: Description is a user-facing - description of the parameter that may - be used to populate a UI. - type: string - name: - description: Name declares the name by - which a parameter is referenced. - type: string - properties: - additionalProperties: - description: PropertySpec defines the - struct for object keys - properties: - type: - description: ParamType indicates - the type of an input parameter; - Used to distinguish between a - single string and an array of - strings. - type: string - type: object - description: Properties is the JSON Schema - properties to support key-value pairs - parameter. - type: object - type: - description: Type is the user-specified - type of the parameter. The possible - types are currently "string", "array" - and "object", and "string" is the default. - type: string - required: - - name - type: object - type: array - resources: - description: Resources is a list of the input - resources required to run the task. Resources - are represented in TaskRuns as bindings to - instances of PipelineResources. - items: - description: TaskResource defines an input - or output Resource declared as a requirement - by a Task. The Name field will be used to - refer to these Resources within the Task - definition, and when provided as an Input, - the Name will be the path to the volume - mounted containing this Resource as an input - (e.g. an input Resource named `workspace` - will be mounted at `/workspace`). - properties: - description: - description: Description is a user-facing - description of the declared resource - that may be used to populate a UI. - type: string - name: - description: Name declares the name by - which a resource is referenced in the - definition. Resources may be referenced - by name in the definition of a Task's - steps. - type: string - optional: - description: 'Optional declares the resource - as optional. By default optional is - set to false which makes a resource - required. optional: true - the resource - is considered optional optional: false - - the resource is considered required - (equivalent of not specifying it)' - type: boolean - targetPath: - description: TargetPath is the path in - workspace directory where the resource - will be copied. - type: string - type: - description: Type is the type of this - resource; - type: string - required: - - name - - type - type: object - type: array - type: object - outputs: - description: Outputs is an optional set of resources - and results produced when this Task is run. + kind: + type: string + metadata: + description: PipelineTaskMetadata contains the labels + or annotations for an EmbeddedTask properties: - resources: - items: - description: TaskResource defines an input - or output Resource declared as a requirement - by a Task. The Name field will be used to - refer to these Resources within the Task - definition, and when provided as an Input, - the Name will be the path to the volume - mounted containing this Resource as an input - (e.g. an input Resource named `workspace` - will be mounted at `/workspace`). - properties: - description: - description: Description is a user-facing - description of the declared resource - that may be used to populate a UI. - type: string - name: - description: Name declares the name by - which a resource is referenced in the - definition. Resources may be referenced - by name in the definition of a Task's - steps. - type: string - optional: - description: 'Optional declares the resource - as optional. By default optional is - set to false which makes a resource - required. optional: true - the resource - is considered optional optional: false - - the resource is considered required - (equivalent of not specifying it)' - type: boolean - targetPath: - description: TargetPath is the path in - workspace directory where the resource - will be copied. - type: string - type: - description: Type is the type of this - resource; - type: string - required: - - name - - type - type: object - type: array - results: - items: - description: TestResult allows a task to specify - the location where test logs can be found - and what format they will be in. - properties: - format: - description: 'TODO: maybe this is an enum - with types like "go test", "junit", - etc.' - type: string - name: - description: Name declares the name by - which a result is referenced in the - Task's definition. Results may be referenced - by name in the definition of a Task's - steps. - type: string - path: - type: string - required: - - format - - name - - path - type: object - type: array + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object type: object params: description: Params is a list of input parameters @@ -2979,6 +9880,10 @@ spec: type: object type: array x-kubernetes-list-type: atomic + spec: + description: Spec is a specification of a custom + task + type: object stepTemplate: description: StepTemplate can be used as the basis for all step containers within the Task, so that @@ -7869,6 +14774,38 @@ spec: be less than 24h. Refer Go''s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration' type: string + when: + description: WhenExpressions is a list of when expressions + that need to be true for the task to run + items: + description: WhenExpression allows a PipelineTask + to declare expressions to be evaluated before the + Task is run to determine whether the Task should + be executed or skipped + properties: + input: + description: Input is the string for guard checking + which can be a static input or an output from + a parent Task + type: string + operator: + description: Operator that represents an Input's + relationship to the values + type: string + values: + description: Values is an array of strings, which + is compared against the input, for guard checking + It must be non-empty + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - input + - operator + - values + type: object + type: array workspaces: description: Workspaces maps workspaces from the pipeline spec to the workspaces declared in the Task. @@ -7895,8 +14832,10 @@ spec: - name type: object type: array + x-kubernetes-list-type: atomic type: object type: array + x-kubernetes-list-type: atomic workspaces: description: Workspaces declares a set of named workspaces that are expected to be provided by a PipelineRun. @@ -7925,6 +14864,7 @@ spec: - name type: object type: array + x-kubernetes-list-type: atomic type: object podTemplate: description: PodTemplate holds pod specific configuration @@ -10876,9 +17816,12 @@ spec: type: object type: object type: array + x-kubernetes-list-type: atomic serviceAccountName: type: string serviceAccountNames: + description: 'Deprecated: use taskRunSpecs.ServiceAccountName + instead' items: description: PipelineRunSpecServiceAccountName can be used to configure specific ServiceAccountName for a concrete Task @@ -10889,17 +17832,118 @@ spec: type: string type: object type: array + x-kubernetes-list-type: atomic status: description: Used for cancelling a pipelinerun (and maybe more later on) type: string taskRunSpecs: - description: TaskRunSpecs holds a set of task specific specs + description: TaskRunSpecs holds a set of runtime specs items: - description: PipelineTaskRunSpec holds task specific specs + description: PipelineTaskRunSpec can be used to configure specific + specs for a concrete Task properties: + metadata: + description: PipelineTaskMetadata contains the labels or + annotations for an EmbeddedTask + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object pipelineTaskName: type: string + sidecarOverrides: + items: + description: TaskRunSidecarOverride is used to override + the values of a Sidecar in the corresponding Task. + properties: + name: + description: The name of the Sidecar to override. + type: string + resources: + description: The resource requirements to apply to + the Sidecar. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + required: + - name + - resources + type: object + type: array + x-kubernetes-list-type: atomic + stepOverrides: + items: + description: TaskRunStepOverride is used to override the + values of a Step in the corresponding Task. + properties: + name: + description: The name of the Step to override. + type: string + resources: + description: The resource requirements to apply to + the Step. + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + required: + - name + - resources + type: object + type: array + x-kubernetes-list-type: atomic taskPodTemplate: description: Template holds pod specific configuration properties: @@ -14002,11 +21046,32 @@ spec: type: string type: object type: array + x-kubernetes-list-type: atomic timeout: - description: 'Time after which the Pipeline times out. Defaults - to never. Refer to Go''s ParseDuration documentation for expected + description: 'Timeout Deprecated: use pipelineRunSpec.Timeouts.Pipeline + instead Time after which the Pipeline times out. Defaults to + never. Refer to Go''s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration' type: string + timeouts: + description: Time after which the Pipeline times out. Currently + three keys are accepted in the map pipeline, tasks and finally + with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally + properties: + finally: + description: Finally sets the maximum allowed duration of + this pipeline's finally + type: string + pipeline: + description: Pipeline sets the maximum allowed duration for + execution of the entire pipeline. The sum of individual + timeouts for tasks and finally must not exceed this value. + type: string + tasks: + description: Tasks sets the maximum allowed duration of this + pipeline's tasks + type: string + type: object workspaces: description: Workspaces holds a set of workspace bindings that must match names with those declared in the pipeline. @@ -14516,6 +21581,7 @@ spec: - name type: object type: array + x-kubernetes-list-type: atomic type: object pod_spec: description: PodSpec provides the basis for running the test under diff --git a/hack/make-rules/update/codegen.sh b/hack/make-rules/update/codegen.sh index f5023d701cc4..2b44fb282025 100755 --- a/hack/make-rules/update/codegen.sh +++ b/hack/make-rules/update/codegen.sh @@ -150,7 +150,7 @@ gen-client() { --go-header-file hack/boilerplate/boilerplate.generated.go.txt \ --clientset-name versioned \ --input-base "" \ - --input github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1 \ + --input github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1 \ --output-package k8s.io/test-infra/prow/pipeline/clientset copyfiles "./prow/pipeline/clientset" "*.go" } @@ -168,7 +168,7 @@ gen-lister() { echo "Generating lister for pipeline..." >&2 "$listergen" \ --go-header-file hack/boilerplate/boilerplate.generated.go.txt \ - --input-dirs github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1 \ + --input-dirs github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1 \ --output-package k8s.io/test-infra/prow/pipeline/listers copyfiles "./prow/pipeline/listers" "*.go" } @@ -188,7 +188,7 @@ gen-informer() { echo "Generating informer for pipeline..." >&2 "$informergen" \ --go-header-file hack/boilerplate/boilerplate.generated.go.txt \ - --input-dirs github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1 \ + --input-dirs github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1 \ --versioned-clientset-package k8s.io/test-infra/prow/pipeline/clientset/versioned \ --listers-package k8s.io/test-infra/prow/pipeline/listers \ --output-package k8s.io/test-infra/prow/pipeline/informers diff --git a/prow/apis/prowjobs/v1/types.go b/prow/apis/prowjobs/v1/types.go index 936214cda5f6..ef42fca8b2ec 100644 --- a/prow/apis/prowjobs/v1/types.go +++ b/prow/apis/prowjobs/v1/types.go @@ -25,7 +25,7 @@ import ( "strings" "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -187,7 +187,7 @@ type ProwJobSpec struct { // PipelineRunSpec provides the basis for running the test as // a pipeline-crd resource // https://github.com/tektoncd/pipeline - PipelineRunSpec *pipelinev1alpha1.PipelineRunSpec `json:"pipeline_run_spec,omitempty"` + PipelineRunSpec *pipelinev1beta1.PipelineRunSpec `json:"pipeline_run_spec,omitempty"` // DecorationConfig holds configuration options for // decorating PodSpecs that users provide diff --git a/prow/apis/prowjobs/v1/zz_generated.deepcopy.go b/prow/apis/prowjobs/v1/zz_generated.deepcopy.go index f86dd324e6e6..823d4ea5b5b6 100644 --- a/prow/apis/prowjobs/v1/zz_generated.deepcopy.go +++ b/prow/apis/prowjobs/v1/zz_generated.deepcopy.go @@ -24,7 +24,7 @@ package v1 import ( url "net/url" - v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -378,7 +378,7 @@ func (in *ProwJobSpec) DeepCopyInto(out *ProwJobSpec) { } if in.PipelineRunSpec != nil { in, out := &in.PipelineRunSpec, &out.PipelineRunSpec - *out = new(v1alpha1.PipelineRunSpec) + *out = new(v1beta1.PipelineRunSpec) (*in).DeepCopyInto(*out) } if in.DecorationConfig != nil { diff --git a/prow/cmd/pipeline/controller.go b/prow/cmd/pipeline/controller.go index 7631df775f49..548ad0076b46 100644 --- a/prow/cmd/pipeline/controller.go +++ b/prow/cmd/pipeline/controller.go @@ -36,7 +36,8 @@ import ( "k8s.io/test-infra/prow/pod-utils/downwardapi" "github.com/sirupsen/logrus" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" untypedcorev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -259,7 +260,7 @@ func (c *controller) enqueueKey(ctx string, obj interface{}) { ns = o.Namespace } c.workqueue.AddRateLimited(toKey(ctx, ns, o.Name)) - case *pipelinev1alpha1.PipelineRun: + case *pipelinev1beta1.PipelineRun: c.workqueue.AddRateLimited(toKey(ctx, o.Namespace, o.Name)) default: logrus.Warnf("cannot enqueue unknown type %T: %v", o, obj) @@ -270,9 +271,9 @@ func (c *controller) enqueueKey(ctx string, obj interface{}) { type reconciler interface { getProwJob(name string) (*prowjobv1.ProwJob, error) patchProwJob(pj *prowjobv1.ProwJob, newpj *prowjobv1.ProwJob) (*prowjobv1.ProwJob, error) - getPipelineRun(context, namespace, name string) (*pipelinev1alpha1.PipelineRun, error) + getPipelineRun(context, namespace, name string) (*pipelinev1beta1.PipelineRun, error) deletePipelineRun(context, namespace, name string) error - createPipelineRun(context, namespace string, b *pipelinev1alpha1.PipelineRun) (*pipelinev1alpha1.PipelineRun, error) + createPipelineRun(context, namespace string, b *pipelinev1beta1.PipelineRun) (*pipelinev1beta1.PipelineRun, error) pipelineID(prowjobv1.ProwJob) (string, string, error) now() metav1.Time } @@ -299,7 +300,7 @@ func (c *controller) patchProwJob(pj *prowjobv1.ProwJob, newpj *prowjobv1.ProwJo return pjutil.PatchProwjob(context.TODO(), c.pjc.ProwV1().ProwJobs(c.pjNamespace()), logrus.NewEntry(logrus.StandardLogger()), *pj, *newpj) } -func (c *controller) getPipelineRun(context, namespace, name string) (*pipelinev1alpha1.PipelineRun, error) { +func (c *controller) getPipelineRun(context, namespace, name string) (*pipelinev1beta1.PipelineRun, error) { p, err := c.getPipelineConfig(context) if err != nil { return nil, err @@ -313,16 +314,16 @@ func (c *controller) deletePipelineRun(pContext, namespace, name string) error { if err != nil { return err } - return p.client.TektonV1alpha1().PipelineRuns(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) + return p.client.TektonV1beta1().PipelineRuns(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) } -func (c *controller) createPipelineRun(pContext, namespace string, p *pipelinev1alpha1.PipelineRun) (*pipelinev1alpha1.PipelineRun, error) { +func (c *controller) createPipelineRun(pContext, namespace string, p *pipelinev1beta1.PipelineRun) (*pipelinev1beta1.PipelineRun, error) { logrus.Debugf("createPipelineRun(%s,%s,%s)", pContext, namespace, p.Name) pc, err := c.getPipelineConfig(pContext) if err != nil { return nil, err } - p, err = pc.client.TektonV1alpha1().PipelineRuns(namespace).Create(context.TODO(), p, metav1.CreateOptions{}) + p, err = pc.client.TektonV1beta1().PipelineRuns(namespace).Create(context.TODO(), p, metav1.CreateOptions{}) if err != nil { return p, err } @@ -504,7 +505,7 @@ const ( ) // prowJobStatus returns the desired state and description based on the pipeline status -func prowJobStatus(ps pipelinev1alpha1.PipelineRunStatus) (prowjobv1.ProwJobState, string) { +func prowJobStatus(ps pipelinev1beta1.PipelineRunStatus) (prowjobv1.ProwJobState, string) { started := ps.StartTime finished := ps.CompletionTime pcond := ps.GetCondition(apis.ConditionSucceeded) @@ -542,7 +543,7 @@ func pipelineMeta(name string, pj prowjobv1.ProwJob) metav1.ObjectMeta { } // makePipelineGitResource creates a pipeline git resource from prow job -func makePipelineGitResource(name string, refs prowjobv1.Refs, pj prowjobv1.ProwJob) *pipelinev1alpha1.PipelineResource { +func makePipelineGitResource(name string, refs prowjobv1.Refs, pj prowjobv1.ProwJob) *resourcev1alpha1.PipelineResource { // Pick source URL var sourceURL string switch { @@ -569,11 +570,11 @@ func makePipelineGitResource(name string, refs prowjobv1.Refs, pj prowjobv1.Prow revision = refs.BaseRef } - pr := pipelinev1alpha1.PipelineResource{ + pr := resourcev1alpha1.PipelineResource{ ObjectMeta: pipelineMeta(name, pj), - Spec: pipelinev1alpha1.PipelineResourceSpec{ - Type: pipelinev1alpha1.PipelineResourceTypeGit, - Params: []pipelinev1alpha1.ResourceParam{ + Spec: resourcev1alpha1.PipelineResourceSpec{ + Type: resourcev1alpha1.PipelineResourceTypeGit, + Params: []resourcev1alpha1.ResourceParam{ { Name: "url", Value: sourceURL, @@ -590,7 +591,7 @@ func makePipelineGitResource(name string, refs prowjobv1.Refs, pj prowjobv1.Prow // makePipeline creates a PipelineRun and substitutes ProwJob managed pipeline resources with ResourceSpec instead of ResourceRef // so that we don't have to take care of potentially dangling created pipeline resources. -func makePipelineRun(pj prowjobv1.ProwJob) (*pipelinev1alpha1.PipelineRun, error) { +func makePipelineRun(pj prowjobv1.ProwJob) (*pipelinev1beta1.PipelineRun, error) { // First validate. if pj.Spec.PipelineRunSpec == nil { return nil, errors.New("no PipelineSpec defined") @@ -603,7 +604,7 @@ func makePipelineRun(pj prowjobv1.ProwJob) (*pipelinev1alpha1.PipelineRun, error return nil, fmt.Errorf("invalid pipeline_run_spec: %w", err) } - p := pipelinev1alpha1.PipelineRun{ + p := pipelinev1beta1.PipelineRun{ ObjectMeta: pipelineMeta(pj.Name, pj), Spec: *pj.Spec.PipelineRunSpec.DeepCopy(), } @@ -616,10 +617,10 @@ func makePipelineRun(pj prowjobv1.ProwJob) (*pipelinev1alpha1.PipelineRun, error for _, key := range sets.StringKeySet(env).List() { val := env[key] // TODO: make this handle existing values/substitutions. - p.Spec.Params = append(p.Spec.Params, pipelinev1alpha1.Param{ + p.Spec.Params = append(p.Spec.Params, pipelinev1beta1.Param{ Name: key, - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: val, }, }) diff --git a/prow/cmd/pipeline/controller_test.go b/prow/cmd/pipeline/controller_test.go index ce542e15ed35..f0341d2a6daf 100644 --- a/prow/cmd/pipeline/controller_test.go +++ b/prow/cmd/pipeline/controller_test.go @@ -26,6 +26,7 @@ import ( "github.com/sirupsen/logrus" pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -54,7 +55,7 @@ const ( type fakeReconciler struct { jobs map[string]prowjobv1.ProwJob - pipelines map[string]pipelinev1alpha1.PipelineRun + pipelines map[string]pipelinev1beta1.PipelineRun nows metav1.Time } @@ -95,7 +96,7 @@ func (r *fakeReconciler) patchProwJob(pj *prowjobv1.ProwJob, newpj *prowjobv1.Pr return newpj, nil } -func (r *fakeReconciler) getPipelineRun(context, namespace, name string) (*pipelinev1alpha1.PipelineRun, error) { +func (r *fakeReconciler) getPipelineRun(context, namespace, name string) (*pipelinev1beta1.PipelineRun, error) { logrus.Debugf("getPipelineRun: ctx=%s, ns=%s, name=%s", context, namespace, name) if namespace == errorGetPipelineRun { return nil, errors.New("injected create pipeline error") @@ -103,7 +104,7 @@ func (r *fakeReconciler) getPipelineRun(context, namespace, name string) (*pipel k := toKey(context, namespace, name) p, present := r.pipelines[k] if !present { - return nil, apierrors.NewNotFound(pipelinev1alpha1.Resource("PipelineRun"), name) + return nil, apierrors.NewNotFound(pipelinev1beta1.Resource("PipelineRun"), name) } return &p, nil } @@ -115,13 +116,13 @@ func (r *fakeReconciler) deletePipelineRun(context, namespace, name string) erro } k := toKey(context, namespace, name) if _, present := r.pipelines[k]; !present { - return apierrors.NewNotFound(pipelinev1alpha1.Resource("PipelineRun"), name) + return apierrors.NewNotFound(pipelinev1beta1.Resource("PipelineRun"), name) } delete(r.pipelines, k) return nil } -func (r *fakeReconciler) createPipelineRun(context, namespace string, p *pipelinev1alpha1.PipelineRun) (*pipelinev1alpha1.PipelineRun, error) { +func (r *fakeReconciler) createPipelineRun(context, namespace string, p *pipelinev1beta1.PipelineRun) (*pipelinev1beta1.PipelineRun, error) { logrus.Debugf("createPipelineRun: ctx=%s, ns=%s", context, namespace) if p == nil { return nil, errors.New("nil pipeline") @@ -181,7 +182,7 @@ func TestEnqueueKey(t *testing.T) { { name: "enqueue pipeline directly", context: "hey", - obj: &pipelinev1alpha1.PipelineRun{ + obj: &pipelinev1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Namespace: "foo", Name: "bar", @@ -227,11 +228,11 @@ func TestEnqueueKey(t *testing.T) { func TestReconcile(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) now := metav1.Now() - pipelineSpec := pipelinev1alpha1.PipelineRunSpec{} - noJobChange := func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + pipelineSpec := pipelinev1beta1.PipelineRunSpec{} + noJobChange := func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { return pj } - noPipelineRunChange := func(_ prowjobv1.ProwJob, p pipelinev1alpha1.PipelineRun) pipelinev1alpha1.PipelineRun { + noPipelineRunChange := func(_ prowjobv1.ProwJob, p pipelinev1beta1.PipelineRun) pipelinev1beta1.PipelineRun { return p } cases := []struct { @@ -239,9 +240,9 @@ func TestReconcile(t *testing.T) { namespace string context string observedJob *prowjobv1.ProwJob - observedPipelineRun *pipelinev1alpha1.PipelineRun - expectedJob func(prowjobv1.ProwJob, pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob - expectedPipelineRun func(prowjobv1.ProwJob, pipelinev1alpha1.PipelineRun) pipelinev1alpha1.PipelineRun + observedPipelineRun *pipelinev1beta1.PipelineRun + expectedJob func(prowjobv1.ProwJob, pipelinev1beta1.PipelineRun) prowjobv1.ProwJob + expectedPipelineRun func(prowjobv1.ProwJob, pipelinev1beta1.PipelineRun) pipelinev1beta1.PipelineRun err bool }{ { @@ -255,7 +256,7 @@ func TestReconcile(t *testing.T) { BuildID: pipelineID, }, }, - expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { pj.Status = prowjobv1.ProwJobStatus{ StartTime: now, PendingTime: &now, @@ -265,7 +266,7 @@ func TestReconcile(t *testing.T) { } return pj }, - expectedPipelineRun: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) pipelinev1alpha1.PipelineRun { + expectedPipelineRun: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) pipelinev1beta1.PipelineRun { pj.Spec.Type = prowjobv1.PeriodicJob p, err := makePipelineRun(pj) if err != nil { @@ -317,10 +318,10 @@ func TestReconcile(t *testing.T) { }, { name: "delete pipeline run after deleting prowjob", - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob - pj.Spec.PipelineRunSpec = &pipelinev1alpha1.PipelineRunSpec{} + pj.Spec.PipelineRunSpec = &pipelinev1beta1.PipelineRunSpec{} pj.Status.BuildID = pipelineID p, err := makePipelineRun(pj) if err != nil { @@ -331,10 +332,10 @@ func TestReconcile(t *testing.T) { }, { name: "do not delete deleted pipeline runs", - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob - pj.Spec.PipelineRunSpec = &pipelinev1alpha1.PipelineRunSpec{} + pj.Spec.PipelineRunSpec = &pipelinev1beta1.PipelineRunSpec{} pj.Status.BuildID = pipelineID p, err := makePipelineRun(pj) p.DeletionTimestamp = &now @@ -347,10 +348,10 @@ func TestReconcile(t *testing.T) { }, { name: "only delete pipeline runs created by controller", - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob - pj.Spec.PipelineRunSpec = &pipelinev1alpha1.PipelineRunSpec{} + pj.Spec.PipelineRunSpec = &pipelinev1beta1.PipelineRunSpec{} pj.Status.BuildID = pipelineID p, err := makePipelineRun(pj) if err != nil { @@ -368,7 +369,7 @@ func TestReconcile(t *testing.T) { Spec: prowjobv1.ProwJobSpec{ Agent: prowjobv1.TektonAgent, Cluster: "target-cluster", - PipelineRunSpec: &pipelinev1alpha1.PipelineRunSpec{ + PipelineRunSpec: &pipelinev1beta1.PipelineRunSpec{ ServiceAccountName: "robot", }, }, @@ -378,7 +379,7 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -399,7 +400,7 @@ func TestReconcile(t *testing.T) { Spec: prowjobv1.ProwJobSpec{ Agent: prowjobv1.TektonAgent, Cluster: "target-cluster", - PipelineRunSpec: &pipelinev1alpha1.PipelineRunSpec{ + PipelineRunSpec: &pipelinev1beta1.PipelineRunSpec{ ServiceAccountName: "robot", }, }, @@ -409,7 +410,7 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -430,7 +431,7 @@ func TestReconcile(t *testing.T) { observedJob: &prowjobv1.ProwJob{ Spec: prowjobv1.ProwJobSpec{ Agent: prowjobv1.TektonAgent, - PipelineRunSpec: &pipelinev1alpha1.PipelineRunSpec{ + PipelineRunSpec: &pipelinev1beta1.PipelineRunSpec{ ServiceAccountName: "robot", }, }, @@ -440,11 +441,11 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent - pj.Spec.PipelineRunSpec = &pipelinev1alpha1.PipelineRunSpec{ + pj.Spec.PipelineRunSpec = &pipelinev1beta1.PipelineRunSpec{ ServiceAccountName: "robot", } pj.Status.BuildID = pipelineID @@ -454,7 +455,7 @@ func TestReconcile(t *testing.T) { } return p }(), - expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { pj.Status.State = prowjobv1.PendingState pj.Status.Description = descScheduling return pj @@ -473,7 +474,7 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -489,7 +490,7 @@ func TestReconcile(t *testing.T) { }) return p }(), - expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { pj.Status = prowjobv1.ProwJobStatus{ StartTime: now, State: prowjobv1.PendingState, @@ -511,7 +512,7 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -528,7 +529,7 @@ func TestReconcile(t *testing.T) { }) return p }(), - expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { pj.Status = prowjobv1.ProwJobStatus{ StartTime: now, CompletionTime: &now, @@ -551,7 +552,7 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -568,7 +569,7 @@ func TestReconcile(t *testing.T) { }) return p }(), - expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { pj.Status = prowjobv1.ProwJobStatus{ StartTime: now, CompletionTime: &now, @@ -598,7 +599,7 @@ func TestReconcile(t *testing.T) { name: "error when we cannot get pipeline run", namespace: errorGetPipelineRun, err: true, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -620,10 +621,10 @@ func TestReconcile(t *testing.T) { name: "error when we cannot delete pipeline run", namespace: errorDeletePipelineRun, err: true, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob - pj.Spec.PipelineRunSpec = &pipelinev1alpha1.PipelineRunSpec{} + pj.Spec.PipelineRunSpec = &pipelinev1beta1.PipelineRunSpec{} pj.Status.BuildID = pipelineID p, err := makePipelineRun(pj) if err != nil { @@ -642,7 +643,7 @@ func TestReconcile(t *testing.T) { PipelineRunSpec: &pipelineSpec, }, }, - expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1alpha1.PipelineRun) prowjobv1.ProwJob { + expectedJob: func(pj prowjobv1.ProwJob, _ pipelinev1beta1.PipelineRun) prowjobv1.ProwJob { pj.Status = prowjobv1.ProwJobStatus{ BuildID: pipelineID, StartTime: now, @@ -680,7 +681,7 @@ func TestReconcile(t *testing.T) { Description: "fancy", }, }, - observedPipelineRun: func() *pipelinev1alpha1.PipelineRun { + observedPipelineRun: func() *pipelinev1beta1.PipelineRun { pj := prowjobv1.ProwJob{} pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Agent = prowjobv1.TektonAgent @@ -713,7 +714,7 @@ func TestReconcile(t *testing.T) { } r := &fakeReconciler{ jobs: map[string]prowjobv1.ProwJob{}, - pipelines: map[string]pipelinev1alpha1.PipelineRun{}, + pipelines: map[string]pipelinev1beta1.PipelineRun{}, nows: now, } @@ -734,7 +735,7 @@ func TestReconcile(t *testing.T) { if j := tc.expectedJob; j != nil { expectedJobs[jk] = j(r.jobs[jk], r.pipelines[pk]) } - expectedPipelineRuns := map[string]pipelinev1alpha1.PipelineRun{} + expectedPipelineRuns := map[string]pipelinev1beta1.PipelineRun{} if p := tc.expectedPipelineRun; p != nil { expectedPipelineRuns[pk] = p(r.jobs[jk], r.pipelines[pk]) } @@ -850,8 +851,8 @@ func TestMakePipelineGitResource(t *testing.T) { expected := &pipelinev1alpha1.PipelineResource{ ObjectMeta: pipelineMeta(resourceName, pj), Spec: pipelinev1alpha1.PipelineResourceSpec{ - Type: pipelinev1alpha1.PipelineResourceTypeGit, - Params: []pipelinev1alpha1.ResourceParam{ + Type: pipelinev1beta1.PipelineResourceTypeGit, + Params: []pipelinev1beta1.ResourceParam{ { Name: "url", Value: tc.expectedURL, @@ -875,7 +876,7 @@ func TestMakeResources(t *testing.T) { cases := []struct { name string job func(prowjobv1.ProwJob) prowjobv1.ProwJob - pipelineRun func(pipelinev1alpha1.PipelineRun) pipelinev1alpha1.PipelineRun + pipelineRun func(pipelinev1beta1.PipelineRun) pipelinev1beta1.PipelineRun err bool }{ { @@ -899,76 +900,76 @@ func TestMakeResources(t *testing.T) { }, }, } - pj.Spec.PipelineRunSpec.Resources = []pipelinev1alpha1.PipelineResourceBinding{ + pj.Spec.PipelineRunSpec.Resources = []pipelinev1beta1.PipelineResourceBinding{ { Name: "implicit git resource", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: config.ProwImplicitGitResource}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: config.ProwImplicitGitResource}, }, } return pj }, - pipelineRun: func(pr pipelinev1alpha1.PipelineRun) pipelinev1alpha1.PipelineRun { - pr.Spec.Params[4].Value = pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + pipelineRun: func(pr pipelinev1beta1.PipelineRun) pipelinev1beta1.PipelineRun { + pr.Spec.Params[4].Value = pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: string(prowjobv1.PresubmitJob), } pr.Spec.Params = append(pr.Spec.Params, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "PULL_BASE_REF", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "feature-branch", }, }, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "PULL_BASE_SHA", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "", }, }, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "PULL_NUMBER", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "1", }, }, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "PULL_PULL_SHA", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "", }, }, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "PULL_REFS", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "feature-branch,1:", }, }, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "REPO_NAME", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "", }, }, - pipelinev1alpha1.Param{ + pipelinev1beta1.Param{ Name: "REPO_OWNER", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "", }, }, ) - pr.Spec.Resources = []pipelinev1alpha1.PipelineResourceBinding{ + pr.Spec.Resources = []pipelinev1beta1.PipelineResourceBinding{ { Name: "implicit git resource", ResourceSpec: &pipelinev1alpha1.PipelineResourceSpec{ Type: "git", - Params: []pipelinev1alpha1.ResourceParam{ + Params: []pipelinev1beta1.ResourceParam{ {Name: "url", Value: "https://source.host/test/test.git"}, {Name: "revision", Value: "pull/1/head"}, }, @@ -982,25 +983,25 @@ func TestMakeResources(t *testing.T) { name: "configure sources when extra refs are configured", job: func(pj prowjobv1.ProwJob) prowjobv1.ProwJob { pj.Spec.ExtraRefs = []prowjobv1.Refs{{Org: "org0"}, {Org: "org1"}} - pj.Spec.PipelineRunSpec.Resources = []pipelinev1alpha1.PipelineResourceBinding{ + pj.Spec.PipelineRunSpec.Resources = []pipelinev1beta1.PipelineResourceBinding{ { Name: "git resource A", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_0"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_0"}, }, { Name: "git resource B", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_1"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_1"}, }, } return pj }, - pipelineRun: func(pr pipelinev1alpha1.PipelineRun) pipelinev1alpha1.PipelineRun { - pr.Spec.Resources = []pipelinev1alpha1.PipelineResourceBinding{ + pipelineRun: func(pr pipelinev1beta1.PipelineRun) pipelinev1beta1.PipelineRun { + pr.Spec.Resources = []pipelinev1beta1.PipelineResourceBinding{ { Name: "git resource A", ResourceSpec: &pipelinev1alpha1.PipelineResourceSpec{ Type: "git", - Params: []pipelinev1alpha1.ResourceParam{ + Params: []pipelinev1beta1.ResourceParam{ {Name: "url", Value: "https://github.com/org0/.git"}, {Name: "revision"}, }, @@ -1010,7 +1011,7 @@ func TestMakeResources(t *testing.T) { Name: "git resource B", ResourceSpec: &pipelinev1alpha1.PipelineResourceSpec{ Type: "git", - Params: []pipelinev1alpha1.ResourceParam{ + Params: []pipelinev1beta1.ResourceParam{ {Name: "url", Value: "https://github.com/org1/.git"}, {Name: "revision"}, }, @@ -1023,14 +1024,14 @@ func TestMakeResources(t *testing.T) { { name: "do not override unrelated git resources", job: func(pj prowjobv1.ProwJob) prowjobv1.ProwJob { - pj.Spec.PipelineRunSpec.Resources = []pipelinev1alpha1.PipelineResourceBinding{ + pj.Spec.PipelineRunSpec.Resources = []pipelinev1beta1.PipelineResourceBinding{ { Name: "git resource A", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_LOL_JK"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_LOL_JK"}, }, { Name: "git resource B", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "some-other-ref"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "some-other-ref"}, }, } return pj @@ -1046,7 +1047,7 @@ func TestMakeResources(t *testing.T) { pj.Namespace = "hello" pj.Spec.Type = prowjobv1.PeriodicJob pj.Spec.Job = "ci-job" - pj.Spec.PipelineRunSpec = &pipelinev1alpha1.PipelineRunSpec{} + pj.Spec.PipelineRunSpec = &pipelinev1beta1.PipelineRunSpec{} pj.Status.BuildID = randomPipelineRunID if tc.job != nil { @@ -1067,50 +1068,50 @@ func TestMakeResources(t *testing.T) { if err != nil { t.Errorf("failed to marshal job spec: %v", err) } - expectedRun := pipelinev1alpha1.PipelineRun{ + expectedRun := pipelinev1beta1.PipelineRun{ ObjectMeta: pipelineMeta(pj.Name, pj), Spec: *pj.Spec.PipelineRunSpec, } - expectedRun.Spec.Params = []pipelinev1alpha1.Param{ + expectedRun.Spec.Params = []pipelinev1beta1.Param{ { Name: "BUILD_ID", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: randomPipelineRunID, }, }, { Name: "CI", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "true", }, }, { Name: "JOB_NAME", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: pj.Spec.Job, }, }, { Name: "JOB_SPEC", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: string(jobSpecRaw), }, }, { Name: "JOB_TYPE", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: string(prowjobv1.PeriodicJob), }, }, { Name: "PROW_JOB_ID", - Value: pipelinev1alpha1.ArrayOrString{ - Type: pipelinev1alpha1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: pj.Name, }, }, @@ -1170,7 +1171,7 @@ func TestProwJobStatus(t *testing.T) { later := metav1.NewTime(now.Time.Add(1 * time.Hour)) cases := []struct { name string - input pipelinev1alpha1.PipelineRunStatus + input pipelinev1beta1.PipelineRunStatus state prowjobv1.ProwJobState desc string fallback string @@ -1182,7 +1183,7 @@ func TestProwJobStatus(t *testing.T) { }, { name: "truly succeeded state returns success", - input: pipelinev1alpha1.PipelineRunStatus{ + input: pipelinev1beta1.PipelineRunStatus{ Status: duckv1beta1.Status{ Conditions: []apis.Condition{ { @@ -1199,7 +1200,7 @@ func TestProwJobStatus(t *testing.T) { }, { name: "falsely succeeded state returns failure", - input: pipelinev1alpha1.PipelineRunStatus{ + input: pipelinev1beta1.PipelineRunStatus{ Status: duckv1beta1.Status{ Conditions: []apis.Condition{ { @@ -1216,7 +1217,7 @@ func TestProwJobStatus(t *testing.T) { }, { name: "unstarted job returns pending/initializing", - input: pipelinev1alpha1.PipelineRunStatus{ + input: pipelinev1beta1.PipelineRunStatus{ Status: duckv1beta1.Status{ Conditions: []apis.Condition{ { @@ -1233,8 +1234,8 @@ func TestProwJobStatus(t *testing.T) { }, { name: "unfinished job returns running", - input: pipelinev1alpha1.PipelineRunStatus{ - PipelineRunStatusFields: pipelinev1alpha1.PipelineRunStatusFields{ + input: pipelinev1beta1.PipelineRunStatus{ + PipelineRunStatusFields: pipelinev1beta1.PipelineRunStatusFields{ StartTime: now.DeepCopy(), }, Status: duckv1beta1.Status{ @@ -1253,8 +1254,8 @@ func TestProwJobStatus(t *testing.T) { }, { name: "pipelines with unknown success status are still running", - input: pipelinev1alpha1.PipelineRunStatus{ - PipelineRunStatusFields: pipelinev1alpha1.PipelineRunStatusFields{ + input: pipelinev1beta1.PipelineRunStatus{ + PipelineRunStatusFields: pipelinev1beta1.PipelineRunStatusFields{ StartTime: now.DeepCopy(), CompletionTime: later.DeepCopy(), }, @@ -1274,8 +1275,8 @@ func TestProwJobStatus(t *testing.T) { }, { name: "completed pipelines without a succeeded condition end in error", - input: pipelinev1alpha1.PipelineRunStatus{ - PipelineRunStatusFields: pipelinev1alpha1.PipelineRunStatusFields{ + input: pipelinev1beta1.PipelineRunStatus{ + PipelineRunStatusFields: pipelinev1beta1.PipelineRunStatusFields{ StartTime: now.DeepCopy(), CompletionTime: later.DeepCopy(), }, diff --git a/prow/cmd/pipeline/main.go b/prow/cmd/pipeline/main.go index 58835252899c..64718a9bee18 100644 --- a/prow/cmd/pipeline/main.go +++ b/prow/cmd/pipeline/main.go @@ -40,7 +40,7 @@ import ( "k8s.io/test-infra/prow/logrusutil" pipelineset "k8s.io/test-infra/prow/pipeline/clientset/versioned" pipelineinfo "k8s.io/test-infra/prow/pipeline/informers/externalversions" - pipelineinfov1alpha1 "k8s.io/test-infra/prow/pipeline/informers/externalversions/pipeline/v1alpha1" + pipelineinfov1beta1 "k8s.io/test-infra/prow/pipeline/informers/externalversions/pipeline/v1beta1" ) type options struct { @@ -78,7 +78,7 @@ func (o *options) parse(flags *flag.FlagSet, args []string) error { type pipelineConfig struct { client pipelineset.Interface - informer pipelineinfov1alpha1.PipelineRunInformer + informer pipelineinfov1beta1.PipelineRunInformer } // newPipelineConfig returns a client and informer capable of mutating and monitoring the specified config. @@ -90,17 +90,17 @@ func newPipelineConfig(cfg rest.Config, stop <-chan struct{}) (*pipelineConfig, // Ensure the pipeline CRD is deployed // TODO(fejta): probably a better way to do this - if _, err := bc.TektonV1alpha1().PipelineRuns("").List(context.TODO(), metav1.ListOptions{Limit: 1}); err != nil { + if _, err := bc.TektonV1beta1().PipelineRuns("").List(context.TODO(), metav1.ListOptions{Limit: 1}); err != nil { return nil, err } // Assume watches receive updates, but resync every 30m in case something wonky happens bif := pipelineinfo.NewSharedInformerFactory(bc, 30*time.Minute) - bif.Tekton().V1alpha1().PipelineRuns().Lister() + bif.Tekton().V1beta1().PipelineRuns().Lister() go bif.Start(stop) return &pipelineConfig{ client: bc, - informer: bif.Tekton().V1alpha1().PipelineRuns(), + informer: bif.Tekton().V1beta1().PipelineRuns(), }, nil } diff --git a/prow/config/config.go b/prow/config/config.go index 9870c994e0c0..1c439273ea3d 100644 --- a/prow/config/config.go +++ b/prow/config/config.go @@ -40,7 +40,7 @@ import ( gitignore "github.com/denormal/go-gitignore" "github.com/google/go-cmp/cmp" "github.com/sirupsen/logrus" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "gopkg.in/robfig/cron.v2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -2642,7 +2642,7 @@ func resolvePresets(name string, labels map[string]string, spec *v1.PodSpec, pre var ReProwExtraRef = regexp.MustCompile(`PROW_EXTRA_GIT_REF_(\d+)`) -func ValidatePipelineRunSpec(jobType prowapi.ProwJobType, extraRefs []prowapi.Refs, spec *pipelinev1alpha1.PipelineRunSpec) error { +func ValidatePipelineRunSpec(jobType prowapi.ProwJobType, extraRefs []prowapi.Refs, spec *pipelinev1beta1.PipelineRunSpec) error { if spec == nil { return nil } diff --git a/prow/config/config_test.go b/prow/config/config_test.go index 1cde61e24318..4303fbd26154 100644 --- a/prow/config/config_test.go +++ b/prow/config/config_test.go @@ -34,7 +34,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" fuzz "github.com/google/gofuzz" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -1439,7 +1439,7 @@ func TestValidatePipelineRunSpec(t *testing.T) { cases := []struct { name string jobType prowapi.ProwJobType - spec func(s *pipelinev1alpha1.PipelineRunSpec) + spec func(s *pipelinev1beta1.PipelineRunSpec) extraRefs []prowapi.Refs noSpec bool pass bool @@ -1456,10 +1456,10 @@ func TestValidatePipelineRunSpec(t *testing.T) { { name: "reject implicit ref for periodic", jobType: prowapi.PeriodicJob, - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_IMPLICIT_GIT_REF"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_IMPLICIT_GIT_REF"}, }) }, pass: false, @@ -1467,10 +1467,10 @@ func TestValidatePipelineRunSpec(t *testing.T) { { name: "allow implicit ref for presubmit", jobType: prowapi.PresubmitJob, - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_IMPLICIT_GIT_REF"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_IMPLICIT_GIT_REF"}, }) }, pass: true, @@ -1478,30 +1478,30 @@ func TestValidatePipelineRunSpec(t *testing.T) { { name: "allow implicit ref for postsubmit", jobType: prowapi.PostsubmitJob, - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_IMPLICIT_GIT_REF"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_IMPLICIT_GIT_REF"}, }) }, pass: true, }, { name: "reject extra refs usage with no extra refs", - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_0"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_0"}, }) }, pass: false, }, { name: "allow extra refs usage with extra refs", - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_0"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_0"}, }) }, extraRefs: []prowapi.Refs{{Org: "o", Repo: "r"}}, @@ -1509,10 +1509,10 @@ func TestValidatePipelineRunSpec(t *testing.T) { }, { name: "reject wrong extra refs index usage", - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_1"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_1"}, }) }, extraRefs: []prowapi.Refs{{Org: "o", Repo: "r"}}, @@ -1525,20 +1525,20 @@ func TestValidatePipelineRunSpec(t *testing.T) { }, { name: "allow unrelated resource refs", - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "some-other-ref"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "some-other-ref"}, }) }, pass: true, }, { name: "reject leading zeros when extra ref usage is otherwise valid", - spec: func(s *pipelinev1alpha1.PipelineRunSpec) { - s.Resources = append(s.Resources, pipelinev1alpha1.PipelineResourceBinding{ + spec: func(s *pipelinev1beta1.PipelineRunSpec) { + s.Resources = append(s.Resources, pipelinev1beta1.PipelineResourceBinding{ Name: "git ref", - ResourceRef: &pipelinev1alpha1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_000"}, + ResourceRef: &pipelinev1beta1.PipelineResourceRef{Name: "PROW_EXTRA_GIT_REF_000"}, }) }, extraRefs: []prowapi.Refs{{Org: "o", Repo: "r"}}, @@ -1546,7 +1546,7 @@ func TestValidatePipelineRunSpec(t *testing.T) { }, } - spec := pipelinev1alpha1.PipelineRunSpec{} + spec := pipelinev1beta1.PipelineRunSpec{} for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { diff --git a/prow/config/jobs.go b/prow/config/jobs.go index 2a9bf643d1fd..911176eb3a10 100644 --- a/prow/config/jobs.go +++ b/prow/config/jobs.go @@ -23,7 +23,7 @@ import ( "strings" "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" @@ -113,7 +113,7 @@ type JobBase struct { // Spec is the Kubernetes pod spec used if Agent is kubernetes. Spec *v1.PodSpec `json:"spec,omitempty"` // PipelineRunSpec is the tekton pipeline spec used if Agent is tekton-pipeline. - PipelineRunSpec *pipelinev1alpha1.PipelineRunSpec `json:"pipeline_run_spec,omitempty"` + PipelineRunSpec *pipelinev1beta1.PipelineRunSpec `json:"pipeline_run_spec,omitempty"` // Annotations are unused by prow itself, but provide a space to configure other automation. Annotations map[string]string `json:"annotations,omitempty"` // ReporterConfig provides the option to configure reporting on job level diff --git a/prow/config/zz_generated.deepcopy.go b/prow/config/zz_generated.deepcopy.go index fde942cc56d4..bb5e3910a0a7 100644 --- a/prow/config/zz_generated.deepcopy.go +++ b/prow/config/zz_generated.deepcopy.go @@ -24,7 +24,7 @@ package config import ( json "encoding/json" - v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/api/core/v1" prowjobsv1 "k8s.io/test-infra/prow/apis/prowjobs/v1" ) @@ -95,7 +95,7 @@ func (in *JobBase) DeepCopyInto(out *JobBase) { } if in.PipelineRunSpec != nil { in, out := &in.PipelineRunSpec, &out.PipelineRunSpec - *out = new(v1alpha1.PipelineRunSpec) + *out = new(v1beta1.PipelineRunSpec) (*in).DeepCopyInto(*out) } if in.Annotations != nil { diff --git a/prow/pipeline/clientset/versioned/clientset.go b/prow/pipeline/clientset/versioned/clientset.go index a353c72622e5..66c1192928a2 100644 --- a/prow/pipeline/clientset/versioned/clientset.go +++ b/prow/pipeline/clientset/versioned/clientset.go @@ -24,24 +24,24 @@ import ( discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" - tektonv1alpha1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1alpha1" + tektonv1beta1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1" ) type Interface interface { Discovery() discovery.DiscoveryInterface - TektonV1alpha1() tektonv1alpha1.TektonV1alpha1Interface + TektonV1beta1() tektonv1beta1.TektonV1beta1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - tektonV1alpha1 *tektonv1alpha1.TektonV1alpha1Client + tektonV1beta1 *tektonv1beta1.TektonV1beta1Client } -// TektonV1alpha1 retrieves the TektonV1alpha1Client -func (c *Clientset) TektonV1alpha1() tektonv1alpha1.TektonV1alpha1Interface { - return c.tektonV1alpha1 +// TektonV1beta1 retrieves the TektonV1beta1Client +func (c *Clientset) TektonV1beta1() tektonv1beta1.TektonV1beta1Interface { + return c.tektonV1beta1 } // Discovery retrieves the DiscoveryClient @@ -65,7 +65,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.tektonV1alpha1, err = tektonv1alpha1.NewForConfig(&configShallowCopy) + cs.tektonV1beta1, err = tektonv1beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -81,7 +81,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.tektonV1alpha1 = tektonv1alpha1.NewForConfigOrDie(c) + cs.tektonV1beta1 = tektonv1beta1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -90,7 +90,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.tektonV1alpha1 = tektonv1alpha1.New(c) + cs.tektonV1beta1 = tektonv1beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/prow/pipeline/clientset/versioned/fake/clientset_generated.go b/prow/pipeline/clientset/versioned/fake/clientset_generated.go index b503891c2987..0bbf8a11ed19 100644 --- a/prow/pipeline/clientset/versioned/fake/clientset_generated.go +++ b/prow/pipeline/clientset/versioned/fake/clientset_generated.go @@ -25,8 +25,8 @@ import ( fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" clientset "k8s.io/test-infra/prow/pipeline/clientset/versioned" - tektonv1alpha1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1alpha1" - faketektonv1alpha1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake" + tektonv1beta1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1" + faketektonv1beta1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -76,7 +76,7 @@ func (c *Clientset) Tracker() testing.ObjectTracker { var _ clientset.Interface = &Clientset{} -// TektonV1alpha1 retrieves the TektonV1alpha1Client -func (c *Clientset) TektonV1alpha1() tektonv1alpha1.TektonV1alpha1Interface { - return &faketektonv1alpha1.FakeTektonV1alpha1{Fake: &c.Fake} +// TektonV1beta1 retrieves the TektonV1beta1Client +func (c *Clientset) TektonV1beta1() tektonv1beta1.TektonV1beta1Interface { + return &faketektonv1beta1.FakeTektonV1beta1{Fake: &c.Fake} } diff --git a/prow/pipeline/clientset/versioned/fake/register.go b/prow/pipeline/clientset/versioned/fake/register.go index 896b18bca13b..0e243efc12de 100644 --- a/prow/pipeline/clientset/versioned/fake/register.go +++ b/prow/pipeline/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - tektonv1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - tektonv1alpha1.AddToScheme, + tektonv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/prow/pipeline/clientset/versioned/scheme/register.go b/prow/pipeline/clientset/versioned/scheme/register.go index 2b959ce1788f..7bc0418cd1ba 100644 --- a/prow/pipeline/clientset/versioned/scheme/register.go +++ b/prow/pipeline/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - tektonv1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - tektonv1alpha1.AddToScheme, + tektonv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/clustertask.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/clustertask.go new file mode 100644 index 000000000000..bc742b4a821d --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/clustertask.go @@ -0,0 +1,168 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + scheme "k8s.io/test-infra/prow/pipeline/clientset/versioned/scheme" +) + +// ClusterTasksGetter has a method to return a ClusterTaskInterface. +// A group's client should implement this interface. +type ClusterTasksGetter interface { + ClusterTasks() ClusterTaskInterface +} + +// ClusterTaskInterface has methods to work with ClusterTask resources. +type ClusterTaskInterface interface { + Create(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.CreateOptions) (*v1beta1.ClusterTask, error) + Update(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.UpdateOptions) (*v1beta1.ClusterTask, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterTask, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterTaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterTask, err error) + ClusterTaskExpansion +} + +// clusterTasks implements ClusterTaskInterface +type clusterTasks struct { + client rest.Interface +} + +// newClusterTasks returns a ClusterTasks +func newClusterTasks(c *TektonV1beta1Client) *clusterTasks { + return &clusterTasks{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterTask, and returns the corresponding clusterTask object, and an error if there is any. +func (c *clusterTasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} + err = c.client.Get(). + Resource("clustertasks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTasks that match those selectors. +func (c *clusterTasks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterTaskList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ClusterTaskList{} + err = c.client.Get(). + Resource("clustertasks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTasks. +func (c *clusterTasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clustertasks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTask and creates it. Returns the server's representation of the clusterTask, and an error, if there is any. +func (c *clusterTasks) Create(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.CreateOptions) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} + err = c.client.Post(). + Resource("clustertasks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTask). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTask and updates it. Returns the server's representation of the clusterTask, and an error, if there is any. +func (c *clusterTasks) Update(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.UpdateOptions) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} + err = c.client.Put(). + Resource("clustertasks"). + Name(clusterTask.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTask). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTask and deletes it. Returns an error if one occurs. +func (c *clusterTasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustertasks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clustertasks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTask. +func (c *clusterTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} + err = c.client.Patch(pt). + Resource("clustertasks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/doc.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/doc.go new file mode 100644 index 000000000000..771101956f36 --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +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 client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/doc.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/doc.go new file mode 100644 index 000000000000..16f44399065e --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +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 client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_clustertask.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_clustertask.go new file mode 100644 index 000000000000..31bfe456fb82 --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_clustertask.go @@ -0,0 +1,122 @@ +/* +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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterTasks implements ClusterTaskInterface +type FakeClusterTasks struct { + Fake *FakeTektonV1beta1 +} + +var clustertasksResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "clustertasks"} + +var clustertasksKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "ClusterTask"} + +// Get takes name of the clusterTask, and returns the corresponding clusterTask object, and an error if there is any. +func (c *FakeClusterTasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterTask, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustertasksResource, name), &v1beta1.ClusterTask{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterTask), err +} + +// List takes label and field selectors, and returns the list of ClusterTasks that match those selectors. +func (c *FakeClusterTasks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterTaskList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustertasksResource, clustertasksKind, opts), &v1beta1.ClusterTaskList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ClusterTaskList{ListMeta: obj.(*v1beta1.ClusterTaskList).ListMeta} + for _, item := range obj.(*v1beta1.ClusterTaskList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterTasks. +func (c *FakeClusterTasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustertasksResource, opts)) +} + +// Create takes the representation of a clusterTask and creates it. Returns the server's representation of the clusterTask, and an error, if there is any. +func (c *FakeClusterTasks) Create(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.CreateOptions) (result *v1beta1.ClusterTask, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustertasksResource, clusterTask), &v1beta1.ClusterTask{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterTask), err +} + +// Update takes the representation of a clusterTask and updates it. Returns the server's representation of the clusterTask, and an error, if there is any. +func (c *FakeClusterTasks) Update(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.UpdateOptions) (result *v1beta1.ClusterTask, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustertasksResource, clusterTask), &v1beta1.ClusterTask{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterTask), err +} + +// Delete takes name of the clusterTask and deletes it. Returns an error if one occurs. +func (c *FakeClusterTasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustertasksResource, name), &v1beta1.ClusterTask{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertasksResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ClusterTaskList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTask. +func (c *FakeClusterTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterTask, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustertasksResource, name, pt, data, subresources...), &v1beta1.ClusterTask{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterTask), err +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline.go new file mode 100644 index 000000000000..bad5a1e64ebc --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline.go @@ -0,0 +1,130 @@ +/* +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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePipelines implements PipelineInterface +type FakePipelines struct { + Fake *FakeTektonV1beta1 + ns string +} + +var pipelinesResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "pipelines"} + +var pipelinesKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "Pipeline"} + +// Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. +func (c *FakePipelines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Pipeline, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(pipelinesResource, c.ns, name), &v1beta1.Pipeline{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Pipeline), err +} + +// List takes label and field selectors, and returns the list of Pipelines that match those selectors. +func (c *FakePipelines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PipelineList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(pipelinesResource, pipelinesKind, c.ns, opts), &v1beta1.PipelineList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PipelineList{ListMeta: obj.(*v1beta1.PipelineList).ListMeta} + for _, item := range obj.(*v1beta1.PipelineList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested pipelines. +func (c *FakePipelines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(pipelinesResource, c.ns, opts)) + +} + +// Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. +func (c *FakePipelines) Create(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.CreateOptions) (result *v1beta1.Pipeline, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(pipelinesResource, c.ns, pipeline), &v1beta1.Pipeline{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Pipeline), err +} + +// Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. +func (c *FakePipelines) Update(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.UpdateOptions) (result *v1beta1.Pipeline, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(pipelinesResource, c.ns, pipeline), &v1beta1.Pipeline{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Pipeline), err +} + +// Delete takes name of the pipeline and deletes it. Returns an error if one occurs. +func (c *FakePipelines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(pipelinesResource, c.ns, name), &v1beta1.Pipeline{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePipelines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pipelinesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.PipelineList{}) + return err +} + +// Patch applies the patch and returns the patched pipeline. +func (c *FakePipelines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Pipeline, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(pipelinesResource, c.ns, name, pt, data, subresources...), &v1beta1.Pipeline{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Pipeline), err +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go new file mode 100644 index 000000000000..40649ff88292 --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go @@ -0,0 +1,56 @@ +/* +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 client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta1 "k8s.io/test-infra/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1" +) + +type FakeTektonV1beta1 struct { + *testing.Fake +} + +func (c *FakeTektonV1beta1) ClusterTasks() v1beta1.ClusterTaskInterface { + return &FakeClusterTasks{c} +} + +func (c *FakeTektonV1beta1) Pipelines(namespace string) v1beta1.PipelineInterface { + return &FakePipelines{c, namespace} +} + +func (c *FakeTektonV1beta1) PipelineRuns(namespace string) v1beta1.PipelineRunInterface { + return &FakePipelineRuns{c, namespace} +} + +func (c *FakeTektonV1beta1) Tasks(namespace string) v1beta1.TaskInterface { + return &FakeTasks{c, namespace} +} + +func (c *FakeTektonV1beta1) TaskRuns(namespace string) v1beta1.TaskRunInterface { + return &FakeTaskRuns{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeTektonV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipelinerun.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipelinerun.go new file mode 100644 index 000000000000..aab911813744 --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipelinerun.go @@ -0,0 +1,142 @@ +/* +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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePipelineRuns implements PipelineRunInterface +type FakePipelineRuns struct { + Fake *FakeTektonV1beta1 + ns string +} + +var pipelinerunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "pipelineruns"} + +var pipelinerunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "PipelineRun"} + +// Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any. +func (c *FakePipelineRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PipelineRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(pipelinerunsResource, c.ns, name), &v1beta1.PipelineRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PipelineRun), err +} + +// List takes label and field selectors, and returns the list of PipelineRuns that match those selectors. +func (c *FakePipelineRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PipelineRunList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(pipelinerunsResource, pipelinerunsKind, c.ns, opts), &v1beta1.PipelineRunList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PipelineRunList{ListMeta: obj.(*v1beta1.PipelineRunList).ListMeta} + for _, item := range obj.(*v1beta1.PipelineRunList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested pipelineRuns. +func (c *FakePipelineRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(pipelinerunsResource, c.ns, opts)) + +} + +// Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any. +func (c *FakePipelineRuns) Create(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.CreateOptions) (result *v1beta1.PipelineRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(pipelinerunsResource, c.ns, pipelineRun), &v1beta1.PipelineRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PipelineRun), err +} + +// Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any. +func (c *FakePipelineRuns) Update(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (result *v1beta1.PipelineRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(pipelinerunsResource, c.ns, pipelineRun), &v1beta1.PipelineRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PipelineRun), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePipelineRuns) UpdateStatus(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(pipelinerunsResource, "status", c.ns, pipelineRun), &v1beta1.PipelineRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PipelineRun), err +} + +// Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs. +func (c *FakePipelineRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(pipelinerunsResource, c.ns, name), &v1beta1.PipelineRun{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePipelineRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pipelinerunsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.PipelineRunList{}) + return err +} + +// Patch applies the patch and returns the patched pipelineRun. +func (c *FakePipelineRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PipelineRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(pipelinerunsResource, c.ns, name, pt, data, subresources...), &v1beta1.PipelineRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.PipelineRun), err +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_task.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_task.go new file mode 100644 index 000000000000..8ec77d8cc10d --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_task.go @@ -0,0 +1,130 @@ +/* +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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTasks implements TaskInterface +type FakeTasks struct { + Fake *FakeTektonV1beta1 + ns string +} + +var tasksResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "tasks"} + +var tasksKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "Task"} + +// Get takes name of the task, and returns the corresponding task object, and an error if there is any. +func (c *FakeTasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Task, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(tasksResource, c.ns, name), &v1beta1.Task{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Task), err +} + +// List takes label and field selectors, and returns the list of Tasks that match those selectors. +func (c *FakeTasks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TaskList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(tasksResource, tasksKind, c.ns, opts), &v1beta1.TaskList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.TaskList{ListMeta: obj.(*v1beta1.TaskList).ListMeta} + for _, item := range obj.(*v1beta1.TaskList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested tasks. +func (c *FakeTasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(tasksResource, c.ns, opts)) + +} + +// Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. +func (c *FakeTasks) Create(ctx context.Context, task *v1beta1.Task, opts v1.CreateOptions) (result *v1beta1.Task, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(tasksResource, c.ns, task), &v1beta1.Task{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Task), err +} + +// Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. +func (c *FakeTasks) Update(ctx context.Context, task *v1beta1.Task, opts v1.UpdateOptions) (result *v1beta1.Task, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(tasksResource, c.ns, task), &v1beta1.Task{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Task), err +} + +// Delete takes name of the task and deletes it. Returns an error if one occurs. +func (c *FakeTasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(tasksResource, c.ns, name), &v1beta1.Task{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(tasksResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.TaskList{}) + return err +} + +// Patch applies the patch and returns the patched task. +func (c *FakeTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Task, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tasksResource, c.ns, name, pt, data, subresources...), &v1beta1.Task{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Task), err +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_taskrun.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_taskrun.go new file mode 100644 index 000000000000..357c232e88ee --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/fake/fake_taskrun.go @@ -0,0 +1,142 @@ +/* +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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTaskRuns implements TaskRunInterface +type FakeTaskRuns struct { + Fake *FakeTektonV1beta1 + ns string +} + +var taskrunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "taskruns"} + +var taskrunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "TaskRun"} + +// Get takes name of the taskRun, and returns the corresponding taskRun object, and an error if there is any. +func (c *FakeTaskRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.TaskRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(taskrunsResource, c.ns, name), &v1beta1.TaskRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TaskRun), err +} + +// List takes label and field selectors, and returns the list of TaskRuns that match those selectors. +func (c *FakeTaskRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TaskRunList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(taskrunsResource, taskrunsKind, c.ns, opts), &v1beta1.TaskRunList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.TaskRunList{ListMeta: obj.(*v1beta1.TaskRunList).ListMeta} + for _, item := range obj.(*v1beta1.TaskRunList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested taskRuns. +func (c *FakeTaskRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(taskrunsResource, c.ns, opts)) + +} + +// Create takes the representation of a taskRun and creates it. Returns the server's representation of the taskRun, and an error, if there is any. +func (c *FakeTaskRuns) Create(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.CreateOptions) (result *v1beta1.TaskRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(taskrunsResource, c.ns, taskRun), &v1beta1.TaskRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TaskRun), err +} + +// Update takes the representation of a taskRun and updates it. Returns the server's representation of the taskRun, and an error, if there is any. +func (c *FakeTaskRuns) Update(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (result *v1beta1.TaskRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(taskrunsResource, c.ns, taskRun), &v1beta1.TaskRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TaskRun), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTaskRuns) UpdateStatus(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(taskrunsResource, "status", c.ns, taskRun), &v1beta1.TaskRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TaskRun), err +} + +// Delete takes name of the taskRun and deletes it. Returns an error if one occurs. +func (c *FakeTaskRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(taskrunsResource, c.ns, name), &v1beta1.TaskRun{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTaskRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(taskrunsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.TaskRunList{}) + return err +} + +// Patch applies the patch and returns the patched taskRun. +func (c *FakeTaskRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TaskRun, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(taskrunsResource, c.ns, name, pt, data, subresources...), &v1beta1.TaskRun{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TaskRun), err +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go new file mode 100644 index 000000000000..89fa0e5b489c --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go @@ -0,0 +1,29 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +type ClusterTaskExpansion interface{} + +type PipelineExpansion interface{} + +type PipelineRunExpansion interface{} + +type TaskExpansion interface{} + +type TaskRunExpansion interface{} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipeline.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipeline.go new file mode 100644 index 000000000000..cd80dff5aab5 --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipeline.go @@ -0,0 +1,178 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + scheme "k8s.io/test-infra/prow/pipeline/clientset/versioned/scheme" +) + +// PipelinesGetter has a method to return a PipelineInterface. +// A group's client should implement this interface. +type PipelinesGetter interface { + Pipelines(namespace string) PipelineInterface +} + +// PipelineInterface has methods to work with Pipeline resources. +type PipelineInterface interface { + Create(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.CreateOptions) (*v1beta1.Pipeline, error) + Update(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.UpdateOptions) (*v1beta1.Pipeline, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Pipeline, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PipelineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Pipeline, err error) + PipelineExpansion +} + +// pipelines implements PipelineInterface +type pipelines struct { + client rest.Interface + ns string +} + +// newPipelines returns a Pipelines +func newPipelines(c *TektonV1beta1Client, namespace string) *pipelines { + return &pipelines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. +func (c *pipelines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pipelines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Pipelines that match those selectors. +func (c *pipelines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PipelineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PipelineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pipelines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested pipelines. +func (c *pipelines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("pipelines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. +func (c *pipelines) Create(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.CreateOptions) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} + err = c.client.Post(). + Namespace(c.ns). + Resource("pipelines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipeline). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. +func (c *pipelines) Update(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.UpdateOptions) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} + err = c.client.Put(). + Namespace(c.ns). + Resource("pipelines"). + Name(pipeline.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipeline). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the pipeline and deletes it. Returns an error if one occurs. +func (c *pipelines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("pipelines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *pipelines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("pipelines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched pipeline. +func (c *pipelines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("pipelines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go new file mode 100644 index 000000000000..8f6fb347a48e --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go @@ -0,0 +1,109 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + rest "k8s.io/client-go/rest" + "k8s.io/test-infra/prow/pipeline/clientset/versioned/scheme" +) + +type TektonV1beta1Interface interface { + RESTClient() rest.Interface + ClusterTasksGetter + PipelinesGetter + PipelineRunsGetter + TasksGetter + TaskRunsGetter +} + +// TektonV1beta1Client is used to interact with features provided by the tekton.dev group. +type TektonV1beta1Client struct { + restClient rest.Interface +} + +func (c *TektonV1beta1Client) ClusterTasks() ClusterTaskInterface { + return newClusterTasks(c) +} + +func (c *TektonV1beta1Client) Pipelines(namespace string) PipelineInterface { + return newPipelines(c, namespace) +} + +func (c *TektonV1beta1Client) PipelineRuns(namespace string) PipelineRunInterface { + return newPipelineRuns(c, namespace) +} + +func (c *TektonV1beta1Client) Tasks(namespace string) TaskInterface { + return newTasks(c, namespace) +} + +func (c *TektonV1beta1Client) TaskRuns(namespace string) TaskRunInterface { + return newTaskRuns(c, namespace) +} + +// NewForConfig creates a new TektonV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*TektonV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &TektonV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new TektonV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *TektonV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new TektonV1beta1Client for the given RESTClient. +func New(c rest.Interface) *TektonV1beta1Client { + return &TektonV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *TektonV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go new file mode 100644 index 000000000000..9f64656d208c --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go @@ -0,0 +1,195 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + scheme "k8s.io/test-infra/prow/pipeline/clientset/versioned/scheme" +) + +// PipelineRunsGetter has a method to return a PipelineRunInterface. +// A group's client should implement this interface. +type PipelineRunsGetter interface { + PipelineRuns(namespace string) PipelineRunInterface +} + +// PipelineRunInterface has methods to work with PipelineRun resources. +type PipelineRunInterface interface { + Create(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.CreateOptions) (*v1beta1.PipelineRun, error) + Update(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) + UpdateStatus(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PipelineRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PipelineRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PipelineRun, err error) + PipelineRunExpansion +} + +// pipelineRuns implements PipelineRunInterface +type pipelineRuns struct { + client rest.Interface + ns string +} + +// newPipelineRuns returns a PipelineRuns +func newPipelineRuns(c *TektonV1beta1Client, namespace string) *pipelineRuns { + return &pipelineRuns{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any. +func (c *pipelineRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pipelineruns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PipelineRuns that match those selectors. +func (c *pipelineRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PipelineRunList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PipelineRunList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pipelineruns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested pipelineRuns. +func (c *pipelineRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("pipelineruns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any. +func (c *pipelineRuns) Create(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.CreateOptions) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} + err = c.client.Post(). + Namespace(c.ns). + Resource("pipelineruns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipelineRun). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any. +func (c *pipelineRuns) Update(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} + err = c.client.Put(). + Namespace(c.ns). + Resource("pipelineruns"). + Name(pipelineRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipelineRun). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *pipelineRuns) UpdateStatus(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} + err = c.client.Put(). + Namespace(c.ns). + Resource("pipelineruns"). + Name(pipelineRun.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(pipelineRun). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs. +func (c *pipelineRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("pipelineruns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *pipelineRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("pipelineruns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched pipelineRun. +func (c *pipelineRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("pipelineruns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/task.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/task.go new file mode 100644 index 000000000000..c421d8de670e --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/task.go @@ -0,0 +1,178 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + scheme "k8s.io/test-infra/prow/pipeline/clientset/versioned/scheme" +) + +// TasksGetter has a method to return a TaskInterface. +// A group's client should implement this interface. +type TasksGetter interface { + Tasks(namespace string) TaskInterface +} + +// TaskInterface has methods to work with Task resources. +type TaskInterface interface { + Create(ctx context.Context, task *v1beta1.Task, opts v1.CreateOptions) (*v1beta1.Task, error) + Update(ctx context.Context, task *v1beta1.Task, opts v1.UpdateOptions) (*v1beta1.Task, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Task, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Task, err error) + TaskExpansion +} + +// tasks implements TaskInterface +type tasks struct { + client rest.Interface + ns string +} + +// newTasks returns a Tasks +func newTasks(c *TektonV1beta1Client, namespace string) *tasks { + return &tasks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the task, and returns the corresponding task object, and an error if there is any. +func (c *tasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} + err = c.client.Get(). + Namespace(c.ns). + Resource("tasks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Tasks that match those selectors. +func (c *tasks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TaskList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.TaskList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("tasks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tasks. +func (c *tasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("tasks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. +func (c *tasks) Create(ctx context.Context, task *v1beta1.Task, opts v1.CreateOptions) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} + err = c.client.Post(). + Namespace(c.ns). + Resource("tasks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(task). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. +func (c *tasks) Update(ctx context.Context, task *v1beta1.Task, opts v1.UpdateOptions) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} + err = c.client.Put(). + Namespace(c.ns). + Resource("tasks"). + Name(task.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(task). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the task and deletes it. Returns an error if one occurs. +func (c *tasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("tasks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("tasks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched task. +func (c *tasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("tasks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/taskrun.go b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/taskrun.go new file mode 100644 index 000000000000..589180dc18fd --- /dev/null +++ b/prow/pipeline/clientset/versioned/typed/pipeline/v1beta1/taskrun.go @@ -0,0 +1,195 @@ +/* +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + scheme "k8s.io/test-infra/prow/pipeline/clientset/versioned/scheme" +) + +// TaskRunsGetter has a method to return a TaskRunInterface. +// A group's client should implement this interface. +type TaskRunsGetter interface { + TaskRuns(namespace string) TaskRunInterface +} + +// TaskRunInterface has methods to work with TaskRun resources. +type TaskRunInterface interface { + Create(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.CreateOptions) (*v1beta1.TaskRun, error) + Update(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) + UpdateStatus(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.TaskRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TaskRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TaskRun, err error) + TaskRunExpansion +} + +// taskRuns implements TaskRunInterface +type taskRuns struct { + client rest.Interface + ns string +} + +// newTaskRuns returns a TaskRuns +func newTaskRuns(c *TektonV1beta1Client, namespace string) *taskRuns { + return &taskRuns{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the taskRun, and returns the corresponding taskRun object, and an error if there is any. +func (c *taskRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} + err = c.client.Get(). + Namespace(c.ns). + Resource("taskruns"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TaskRuns that match those selectors. +func (c *taskRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TaskRunList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.TaskRunList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("taskruns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested taskRuns. +func (c *taskRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("taskruns"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a taskRun and creates it. Returns the server's representation of the taskRun, and an error, if there is any. +func (c *taskRuns) Create(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.CreateOptions) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} + err = c.client.Post(). + Namespace(c.ns). + Resource("taskruns"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(taskRun). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a taskRun and updates it. Returns the server's representation of the taskRun, and an error, if there is any. +func (c *taskRuns) Update(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} + err = c.client.Put(). + Namespace(c.ns). + Resource("taskruns"). + Name(taskRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(taskRun). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *taskRuns) UpdateStatus(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} + err = c.client.Put(). + Namespace(c.ns). + Resource("taskruns"). + Name(taskRun.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(taskRun). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the taskRun and deletes it. Returns an error if one occurs. +func (c *taskRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("taskruns"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *taskRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("taskruns"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched taskRun. +func (c *taskRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("taskruns"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/prow/pipeline/informers/externalversions/generic.go b/prow/pipeline/informers/externalversions/generic.go index 1b5897ef3c40..b5362008616c 100644 --- a/prow/pipeline/informers/externalversions/generic.go +++ b/prow/pipeline/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -52,21 +52,17 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=tekton.dev, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("clustertasks"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().ClusterTasks().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("conditions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().Conditions().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("pipelines"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().Pipelines().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("pipelineruns"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().PipelineRuns().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("runs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().Runs().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("tasks"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().Tasks().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("taskruns"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().TaskRuns().Informer()}, nil + // Group=tekton.dev, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("clustertasks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().ClusterTasks().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("pipelines"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().Pipelines().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("pipelineruns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().PipelineRuns().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("tasks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().Tasks().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("taskruns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().TaskRuns().Informer()}, nil } diff --git a/prow/pipeline/informers/externalversions/pipeline/interface.go b/prow/pipeline/informers/externalversions/pipeline/interface.go index 072feeb0ccdd..ec02a3715e2e 100644 --- a/prow/pipeline/informers/externalversions/pipeline/interface.go +++ b/prow/pipeline/informers/externalversions/pipeline/interface.go @@ -20,13 +20,13 @@ package pipeline import ( internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/informers/externalversions/pipeline/v1alpha1" + v1beta1 "k8s.io/test-infra/prow/pipeline/informers/externalversions/pipeline/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +// V1beta1 returns a new v1beta1.Interface. +func (g *group) V1beta1() v1beta1.Interface { + return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/condition.go b/prow/pipeline/informers/externalversions/pipeline/v1alpha1/condition.go deleted file mode 100644 index a4635eea2355..000000000000 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/condition.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" - internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" -) - -// ConditionInformer provides access to a shared informer and lister for -// Conditions. -type ConditionInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.ConditionLister -} - -type conditionInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewConditionInformer constructs a new informer for Condition type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewConditionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredConditionInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredConditionInformer constructs a new informer for Condition type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredConditionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.TektonV1alpha1().Conditions(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.TektonV1alpha1().Conditions(namespace).Watch(context.TODO(), options) - }, - }, - &pipelinev1alpha1.Condition{}, - resyncPeriod, - indexers, - ) -} - -func (f *conditionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredConditionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *conditionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.Condition{}, f.defaultInformer) -} - -func (f *conditionInformer) Lister() v1alpha1.ConditionLister { - return v1alpha1.NewConditionLister(f.Informer().GetIndexer()) -} diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/run.go b/prow/pipeline/informers/externalversions/pipeline/v1alpha1/run.go deleted file mode 100644 index 3cd0409da76d..000000000000 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/run.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" - internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" -) - -// RunInformer provides access to a shared informer and lister for -// Runs. -type RunInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.RunLister -} - -type runInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewRunInformer constructs a new informer for Run type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewRunInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredRunInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredRunInformer constructs a new informer for Run type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredRunInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.TektonV1alpha1().Runs(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.TektonV1alpha1().Runs(namespace).Watch(context.TODO(), options) - }, - }, - &pipelinev1alpha1.Run{}, - resyncPeriod, - indexers, - ) -} - -func (f *runInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredRunInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *runInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.Run{}, f.defaultInformer) -} - -func (f *runInformer) Lister() v1alpha1.RunLister { - return v1alpha1.NewRunLister(f.Informer().GetIndexer()) -} diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/clustertask.go b/prow/pipeline/informers/externalversions/pipeline/v1beta1/clustertask.go similarity index 83% rename from prow/pipeline/informers/externalversions/pipeline/v1alpha1/clustertask.go rename to prow/pipeline/informers/externalversions/pipeline/v1beta1/clustertask.go index 25dbe2ef63b9..02e77c1222b2 100644 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/clustertask.go +++ b/prow/pipeline/informers/externalversions/pipeline/v1beta1/clustertask.go @@ -16,27 +16,27 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" time "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" + v1beta1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1beta1" ) // ClusterTaskInformer provides access to a shared informer and lister for // ClusterTasks. type ClusterTaskInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.ClusterTaskLister + Lister() v1beta1.ClusterTaskLister } type clusterTaskInformer struct { @@ -61,16 +61,16 @@ func NewFilteredClusterTaskInformer(client versioned.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().ClusterTasks().List(context.TODO(), options) + return client.TektonV1beta1().ClusterTasks().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().ClusterTasks().Watch(context.TODO(), options) + return client.TektonV1beta1().ClusterTasks().Watch(context.TODO(), options) }, }, - &pipelinev1alpha1.ClusterTask{}, + &pipelinev1beta1.ClusterTask{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *clusterTaskInformer) defaultInformer(client versioned.Interface, resync } func (f *clusterTaskInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.ClusterTask{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.ClusterTask{}, f.defaultInformer) } -func (f *clusterTaskInformer) Lister() v1alpha1.ClusterTaskLister { - return v1alpha1.NewClusterTaskLister(f.Informer().GetIndexer()) +func (f *clusterTaskInformer) Lister() v1beta1.ClusterTaskLister { + return v1beta1.NewClusterTaskLister(f.Informer().GetIndexer()) } diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/interface.go b/prow/pipeline/informers/externalversions/pipeline/v1beta1/interface.go similarity index 83% rename from prow/pipeline/informers/externalversions/pipeline/v1alpha1/interface.go rename to prow/pipeline/informers/externalversions/pipeline/v1beta1/interface.go index 2257aff25559..db72ef9ef1f5 100644 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/interface.go +++ b/prow/pipeline/informers/externalversions/pipeline/v1beta1/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" @@ -26,14 +26,10 @@ import ( type Interface interface { // ClusterTasks returns a ClusterTaskInformer. ClusterTasks() ClusterTaskInformer - // Conditions returns a ConditionInformer. - Conditions() ConditionInformer // Pipelines returns a PipelineInformer. Pipelines() PipelineInformer // PipelineRuns returns a PipelineRunInformer. PipelineRuns() PipelineRunInformer - // Runs returns a RunInformer. - Runs() RunInformer // Tasks returns a TaskInformer. Tasks() TaskInformer // TaskRuns returns a TaskRunInformer. @@ -56,11 +52,6 @@ func (v *version) ClusterTasks() ClusterTaskInformer { return &clusterTaskInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Conditions returns a ConditionInformer. -func (v *version) Conditions() ConditionInformer { - return &conditionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Pipelines returns a PipelineInformer. func (v *version) Pipelines() PipelineInformer { return &pipelineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -71,11 +62,6 @@ func (v *version) PipelineRuns() PipelineRunInformer { return &pipelineRunInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Runs returns a RunInformer. -func (v *version) Runs() RunInformer { - return &runInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Tasks returns a TaskInformer. func (v *version) Tasks() TaskInformer { return &taskInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/pipeline.go b/prow/pipeline/informers/externalversions/pipeline/v1beta1/pipeline.go similarity index 83% rename from prow/pipeline/informers/externalversions/pipeline/v1alpha1/pipeline.go rename to prow/pipeline/informers/externalversions/pipeline/v1beta1/pipeline.go index 27ba89944f02..441d5027128c 100644 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/pipeline.go +++ b/prow/pipeline/informers/externalversions/pipeline/v1beta1/pipeline.go @@ -16,27 +16,27 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" time "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" + v1beta1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1beta1" ) // PipelineInformer provides access to a shared informer and lister for // Pipelines. type PipelineInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.PipelineLister + Lister() v1beta1.PipelineLister } type pipelineInformer struct { @@ -62,16 +62,16 @@ func NewFilteredPipelineInformer(client versioned.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().Pipelines(namespace).List(context.TODO(), options) + return client.TektonV1beta1().Pipelines(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().Pipelines(namespace).Watch(context.TODO(), options) + return client.TektonV1beta1().Pipelines(namespace).Watch(context.TODO(), options) }, }, - &pipelinev1alpha1.Pipeline{}, + &pipelinev1beta1.Pipeline{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *pipelineInformer) defaultInformer(client versioned.Interface, resyncPer } func (f *pipelineInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.Pipeline{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.Pipeline{}, f.defaultInformer) } -func (f *pipelineInformer) Lister() v1alpha1.PipelineLister { - return v1alpha1.NewPipelineLister(f.Informer().GetIndexer()) +func (f *pipelineInformer) Lister() v1beta1.PipelineLister { + return v1beta1.NewPipelineLister(f.Informer().GetIndexer()) } diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/pipelinerun.go b/prow/pipeline/informers/externalversions/pipeline/v1beta1/pipelinerun.go similarity index 83% rename from prow/pipeline/informers/externalversions/pipeline/v1alpha1/pipelinerun.go rename to prow/pipeline/informers/externalversions/pipeline/v1beta1/pipelinerun.go index 37682154175e..cd5b3d4de4b1 100644 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/pipelinerun.go +++ b/prow/pipeline/informers/externalversions/pipeline/v1beta1/pipelinerun.go @@ -16,27 +16,27 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" time "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" + v1beta1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1beta1" ) // PipelineRunInformer provides access to a shared informer and lister for // PipelineRuns. type PipelineRunInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.PipelineRunLister + Lister() v1beta1.PipelineRunLister } type pipelineRunInformer struct { @@ -62,16 +62,16 @@ func NewFilteredPipelineRunInformer(client versioned.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().PipelineRuns(namespace).List(context.TODO(), options) + return client.TektonV1beta1().PipelineRuns(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().PipelineRuns(namespace).Watch(context.TODO(), options) + return client.TektonV1beta1().PipelineRuns(namespace).Watch(context.TODO(), options) }, }, - &pipelinev1alpha1.PipelineRun{}, + &pipelinev1beta1.PipelineRun{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *pipelineRunInformer) defaultInformer(client versioned.Interface, resync } func (f *pipelineRunInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.PipelineRun{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.PipelineRun{}, f.defaultInformer) } -func (f *pipelineRunInformer) Lister() v1alpha1.PipelineRunLister { - return v1alpha1.NewPipelineRunLister(f.Informer().GetIndexer()) +func (f *pipelineRunInformer) Lister() v1beta1.PipelineRunLister { + return v1beta1.NewPipelineRunLister(f.Informer().GetIndexer()) } diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/task.go b/prow/pipeline/informers/externalversions/pipeline/v1beta1/task.go similarity index 84% rename from prow/pipeline/informers/externalversions/pipeline/v1alpha1/task.go rename to prow/pipeline/informers/externalversions/pipeline/v1beta1/task.go index f477d219887d..d967e529b4bc 100644 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/task.go +++ b/prow/pipeline/informers/externalversions/pipeline/v1beta1/task.go @@ -16,27 +16,27 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" time "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" + v1beta1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1beta1" ) // TaskInformer provides access to a shared informer and lister for // Tasks. type TaskInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.TaskLister + Lister() v1beta1.TaskLister } type taskInformer struct { @@ -62,16 +62,16 @@ func NewFilteredTaskInformer(client versioned.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().Tasks(namespace).List(context.TODO(), options) + return client.TektonV1beta1().Tasks(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().Tasks(namespace).Watch(context.TODO(), options) + return client.TektonV1beta1().Tasks(namespace).Watch(context.TODO(), options) }, }, - &pipelinev1alpha1.Task{}, + &pipelinev1beta1.Task{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *taskInformer) defaultInformer(client versioned.Interface, resyncPeriod } func (f *taskInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.Task{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.Task{}, f.defaultInformer) } -func (f *taskInformer) Lister() v1alpha1.TaskLister { - return v1alpha1.NewTaskLister(f.Informer().GetIndexer()) +func (f *taskInformer) Lister() v1beta1.TaskLister { + return v1beta1.NewTaskLister(f.Informer().GetIndexer()) } diff --git a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/taskrun.go b/prow/pipeline/informers/externalversions/pipeline/v1beta1/taskrun.go similarity index 84% rename from prow/pipeline/informers/externalversions/pipeline/v1alpha1/taskrun.go rename to prow/pipeline/informers/externalversions/pipeline/v1beta1/taskrun.go index 67ac5feda7f0..33317eff931c 100644 --- a/prow/pipeline/informers/externalversions/pipeline/v1alpha1/taskrun.go +++ b/prow/pipeline/informers/externalversions/pipeline/v1beta1/taskrun.go @@ -16,27 +16,27 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "context" time "time" - pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "k8s.io/test-infra/prow/pipeline/clientset/versioned" internalinterfaces "k8s.io/test-infra/prow/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1alpha1" + v1beta1 "k8s.io/test-infra/prow/pipeline/listers/pipeline/v1beta1" ) // TaskRunInformer provides access to a shared informer and lister for // TaskRuns. type TaskRunInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.TaskRunLister + Lister() v1beta1.TaskRunLister } type taskRunInformer struct { @@ -62,16 +62,16 @@ func NewFilteredTaskRunInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().TaskRuns(namespace).List(context.TODO(), options) + return client.TektonV1beta1().TaskRuns(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha1().TaskRuns(namespace).Watch(context.TODO(), options) + return client.TektonV1beta1().TaskRuns(namespace).Watch(context.TODO(), options) }, }, - &pipelinev1alpha1.TaskRun{}, + &pipelinev1beta1.TaskRun{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *taskRunInformer) defaultInformer(client versioned.Interface, resyncPeri } func (f *taskRunInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha1.TaskRun{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.TaskRun{}, f.defaultInformer) } -func (f *taskRunInformer) Lister() v1alpha1.TaskRunLister { - return v1alpha1.NewTaskRunLister(f.Informer().GetIndexer()) +func (f *taskRunInformer) Lister() v1beta1.TaskRunLister { + return v1beta1.NewTaskRunLister(f.Informer().GetIndexer()) } diff --git a/prow/pipeline/listers/pipeline/v1beta1/clustertask.go b/prow/pipeline/listers/pipeline/v1beta1/clustertask.go new file mode 100644 index 000000000000..8a7714a9d312 --- /dev/null +++ b/prow/pipeline/listers/pipeline/v1beta1/clustertask.go @@ -0,0 +1,68 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterTaskLister helps list ClusterTasks. +// All objects returned here must be treated as read-only. +type ClusterTaskLister interface { + // List lists all ClusterTasks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ClusterTask, err error) + // Get retrieves the ClusterTask from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ClusterTask, error) + ClusterTaskListerExpansion +} + +// clusterTaskLister implements the ClusterTaskLister interface. +type clusterTaskLister struct { + indexer cache.Indexer +} + +// NewClusterTaskLister returns a new ClusterTaskLister. +func NewClusterTaskLister(indexer cache.Indexer) ClusterTaskLister { + return &clusterTaskLister{indexer: indexer} +} + +// List lists all ClusterTasks in the indexer. +func (s *clusterTaskLister) List(selector labels.Selector) (ret []*v1beta1.ClusterTask, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.ClusterTask)) + }) + return ret, err +} + +// Get retrieves the ClusterTask from the index for a given name. +func (s *clusterTaskLister) Get(name string) (*v1beta1.ClusterTask, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("clustertask"), name) + } + return obj.(*v1beta1.ClusterTask), nil +} diff --git a/prow/pipeline/listers/pipeline/v1beta1/expansion_generated.go b/prow/pipeline/listers/pipeline/v1beta1/expansion_generated.go new file mode 100644 index 000000000000..27d27f3c4997 --- /dev/null +++ b/prow/pipeline/listers/pipeline/v1beta1/expansion_generated.go @@ -0,0 +1,55 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +// ClusterTaskListerExpansion allows custom methods to be added to +// ClusterTaskLister. +type ClusterTaskListerExpansion interface{} + +// PipelineListerExpansion allows custom methods to be added to +// PipelineLister. +type PipelineListerExpansion interface{} + +// PipelineNamespaceListerExpansion allows custom methods to be added to +// PipelineNamespaceLister. +type PipelineNamespaceListerExpansion interface{} + +// PipelineRunListerExpansion allows custom methods to be added to +// PipelineRunLister. +type PipelineRunListerExpansion interface{} + +// PipelineRunNamespaceListerExpansion allows custom methods to be added to +// PipelineRunNamespaceLister. +type PipelineRunNamespaceListerExpansion interface{} + +// TaskListerExpansion allows custom methods to be added to +// TaskLister. +type TaskListerExpansion interface{} + +// TaskNamespaceListerExpansion allows custom methods to be added to +// TaskNamespaceLister. +type TaskNamespaceListerExpansion interface{} + +// TaskRunListerExpansion allows custom methods to be added to +// TaskRunLister. +type TaskRunListerExpansion interface{} + +// TaskRunNamespaceListerExpansion allows custom methods to be added to +// TaskRunNamespaceLister. +type TaskRunNamespaceListerExpansion interface{} diff --git a/prow/pipeline/listers/pipeline/v1beta1/pipeline.go b/prow/pipeline/listers/pipeline/v1beta1/pipeline.go new file mode 100644 index 000000000000..efd885d29508 --- /dev/null +++ b/prow/pipeline/listers/pipeline/v1beta1/pipeline.go @@ -0,0 +1,99 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PipelineLister helps list Pipelines. +// All objects returned here must be treated as read-only. +type PipelineLister interface { + // List lists all Pipelines in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) + // Pipelines returns an object that can list and get Pipelines. + Pipelines(namespace string) PipelineNamespaceLister + PipelineListerExpansion +} + +// pipelineLister implements the PipelineLister interface. +type pipelineLister struct { + indexer cache.Indexer +} + +// NewPipelineLister returns a new PipelineLister. +func NewPipelineLister(indexer cache.Indexer) PipelineLister { + return &pipelineLister{indexer: indexer} +} + +// List lists all Pipelines in the indexer. +func (s *pipelineLister) List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Pipeline)) + }) + return ret, err +} + +// Pipelines returns an object that can list and get Pipelines. +func (s *pipelineLister) Pipelines(namespace string) PipelineNamespaceLister { + return pipelineNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PipelineNamespaceLister helps list and get Pipelines. +// All objects returned here must be treated as read-only. +type PipelineNamespaceLister interface { + // List lists all Pipelines in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) + // Get retrieves the Pipeline from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Pipeline, error) + PipelineNamespaceListerExpansion +} + +// pipelineNamespaceLister implements the PipelineNamespaceLister +// interface. +type pipelineNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Pipelines in the indexer for a given namespace. +func (s pipelineNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Pipeline)) + }) + return ret, err +} + +// Get retrieves the Pipeline from the indexer for a given namespace and name. +func (s pipelineNamespaceLister) Get(name string) (*v1beta1.Pipeline, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("pipeline"), name) + } + return obj.(*v1beta1.Pipeline), nil +} diff --git a/prow/pipeline/listers/pipeline/v1beta1/pipelinerun.go b/prow/pipeline/listers/pipeline/v1beta1/pipelinerun.go new file mode 100644 index 000000000000..bc447324838d --- /dev/null +++ b/prow/pipeline/listers/pipeline/v1beta1/pipelinerun.go @@ -0,0 +1,99 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PipelineRunLister helps list PipelineRuns. +// All objects returned here must be treated as read-only. +type PipelineRunLister interface { + // List lists all PipelineRuns in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) + // PipelineRuns returns an object that can list and get PipelineRuns. + PipelineRuns(namespace string) PipelineRunNamespaceLister + PipelineRunListerExpansion +} + +// pipelineRunLister implements the PipelineRunLister interface. +type pipelineRunLister struct { + indexer cache.Indexer +} + +// NewPipelineRunLister returns a new PipelineRunLister. +func NewPipelineRunLister(indexer cache.Indexer) PipelineRunLister { + return &pipelineRunLister{indexer: indexer} +} + +// List lists all PipelineRuns in the indexer. +func (s *pipelineRunLister) List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.PipelineRun)) + }) + return ret, err +} + +// PipelineRuns returns an object that can list and get PipelineRuns. +func (s *pipelineRunLister) PipelineRuns(namespace string) PipelineRunNamespaceLister { + return pipelineRunNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PipelineRunNamespaceLister helps list and get PipelineRuns. +// All objects returned here must be treated as read-only. +type PipelineRunNamespaceLister interface { + // List lists all PipelineRuns in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) + // Get retrieves the PipelineRun from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.PipelineRun, error) + PipelineRunNamespaceListerExpansion +} + +// pipelineRunNamespaceLister implements the PipelineRunNamespaceLister +// interface. +type pipelineRunNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all PipelineRuns in the indexer for a given namespace. +func (s pipelineRunNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.PipelineRun)) + }) + return ret, err +} + +// Get retrieves the PipelineRun from the indexer for a given namespace and name. +func (s pipelineRunNamespaceLister) Get(name string) (*v1beta1.PipelineRun, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("pipelinerun"), name) + } + return obj.(*v1beta1.PipelineRun), nil +} diff --git a/prow/pipeline/listers/pipeline/v1beta1/task.go b/prow/pipeline/listers/pipeline/v1beta1/task.go new file mode 100644 index 000000000000..1ef6c4cfa7cd --- /dev/null +++ b/prow/pipeline/listers/pipeline/v1beta1/task.go @@ -0,0 +1,99 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TaskLister helps list Tasks. +// All objects returned here must be treated as read-only. +type TaskLister interface { + // List lists all Tasks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Task, err error) + // Tasks returns an object that can list and get Tasks. + Tasks(namespace string) TaskNamespaceLister + TaskListerExpansion +} + +// taskLister implements the TaskLister interface. +type taskLister struct { + indexer cache.Indexer +} + +// NewTaskLister returns a new TaskLister. +func NewTaskLister(indexer cache.Indexer) TaskLister { + return &taskLister{indexer: indexer} +} + +// List lists all Tasks in the indexer. +func (s *taskLister) List(selector labels.Selector) (ret []*v1beta1.Task, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Task)) + }) + return ret, err +} + +// Tasks returns an object that can list and get Tasks. +func (s *taskLister) Tasks(namespace string) TaskNamespaceLister { + return taskNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TaskNamespaceLister helps list and get Tasks. +// All objects returned here must be treated as read-only. +type TaskNamespaceLister interface { + // List lists all Tasks in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Task, err error) + // Get retrieves the Task from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Task, error) + TaskNamespaceListerExpansion +} + +// taskNamespaceLister implements the TaskNamespaceLister +// interface. +type taskNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Tasks in the indexer for a given namespace. +func (s taskNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Task, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Task)) + }) + return ret, err +} + +// Get retrieves the Task from the indexer for a given namespace and name. +func (s taskNamespaceLister) Get(name string) (*v1beta1.Task, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("task"), name) + } + return obj.(*v1beta1.Task), nil +} diff --git a/prow/pipeline/listers/pipeline/v1beta1/taskrun.go b/prow/pipeline/listers/pipeline/v1beta1/taskrun.go new file mode 100644 index 000000000000..4cadb966daeb --- /dev/null +++ b/prow/pipeline/listers/pipeline/v1beta1/taskrun.go @@ -0,0 +1,99 @@ +/* +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TaskRunLister helps list TaskRuns. +// All objects returned here must be treated as read-only. +type TaskRunLister interface { + // List lists all TaskRuns in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) + // TaskRuns returns an object that can list and get TaskRuns. + TaskRuns(namespace string) TaskRunNamespaceLister + TaskRunListerExpansion +} + +// taskRunLister implements the TaskRunLister interface. +type taskRunLister struct { + indexer cache.Indexer +} + +// NewTaskRunLister returns a new TaskRunLister. +func NewTaskRunLister(indexer cache.Indexer) TaskRunLister { + return &taskRunLister{indexer: indexer} +} + +// List lists all TaskRuns in the indexer. +func (s *taskRunLister) List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.TaskRun)) + }) + return ret, err +} + +// TaskRuns returns an object that can list and get TaskRuns. +func (s *taskRunLister) TaskRuns(namespace string) TaskRunNamespaceLister { + return taskRunNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TaskRunNamespaceLister helps list and get TaskRuns. +// All objects returned here must be treated as read-only. +type TaskRunNamespaceLister interface { + // List lists all TaskRuns in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) + // Get retrieves the TaskRun from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.TaskRun, error) + TaskRunNamespaceListerExpansion +} + +// taskRunNamespaceLister implements the TaskRunNamespaceLister +// interface. +type taskRunNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TaskRuns in the indexer for a given namespace. +func (s taskRunNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.TaskRun)) + }) + return ret, err +} + +// Get retrieves the TaskRun from the indexer for a given namespace and name. +func (s taskRunNamespaceLister) Get(name string) (*v1beta1.TaskRun, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("taskrun"), name) + } + return obj.(*v1beta1.TaskRun), nil +}