diff --git a/cmd/controller/main.go b/cmd/controller/main.go index c282155a8c4..aa80e20387d 100644 --- a/cmd/controller/main.go +++ b/cmd/controller/main.go @@ -29,7 +29,6 @@ import ( "github.com/tektoncd/pipeline/pkg/reconciler/customrun" "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun" "github.com/tektoncd/pipeline/pkg/reconciler/resolutionrequest" - "github.com/tektoncd/pipeline/pkg/reconciler/run" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/jaeger" @@ -131,7 +130,6 @@ func main() { sharedmain.MainWithConfig(ctx, ControllerLogKey, cfg, taskrun.NewController(opts, clock.RealClock{}, tpTaskrun), pipelinerun.NewController(opts, clock.RealClock{}, tpPipelineRun), - run.NewController(), resolutionrequest.NewController(clock.RealClock{}), customrun.NewController(), ) diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 3107ec666e9..f268f961101 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -51,7 +51,6 @@ import ( var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{ // v1alpha1 - v1alpha1.SchemeGroupVersion.WithKind("Run"): &v1alpha1.Run{}, v1alpha1.SchemeGroupVersion.WithKind("VerificationPolicy"): &v1alpha1.VerificationPolicy{}, // v1beta1 v1beta1.SchemeGroupVersion.WithKind("Pipeline"): &v1beta1.Pipeline{}, diff --git a/config/300-run.yaml b/config/300-run.yaml deleted file mode 100644 index 972c2fb8200..00000000000 --- a/config/300-run.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2020 The Tekton 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 -# -# https://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. - -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: runs.tekton.dev - labels: - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: tekton-pipelines - pipeline.tekton.dev/release: "devel" - version: "devel" -spec: - group: tekton.dev - preserveUnknownFields: false - versions: - - name: v1alpha1 - served: true - storage: true - schema: - openAPIV3Schema: - type: object - # One can use x-kubernetes-preserve-unknown-fields: true - # at the root of the schema (and inside any properties, additionalProperties) - # to get the traditional CRD behaviour that nothing is pruned, despite - # setting spec.preserveUnknownProperties: false. - # - # See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/ - # See issue: https://github.com/knative/serving/issues/912 - x-kubernetes-preserve-unknown-fields: true - additionalPrinterColumns: - - name: Succeeded - type: string - jsonPath: ".status.conditions[?(@.type==\"Succeeded\")].status" - - name: Reason - type: string - jsonPath: ".status.conditions[?(@.type==\"Succeeded\")].reason" - - name: StartTime - type: date - jsonPath: .status.startTime - - name: CompletionTime - type: date - jsonPath: .status.completionTime - # Opt into the status subresource so metadata.generation - # starts to increment - subresources: - status: {} - names: - kind: Run - plural: runs - singular: run - categories: - - tekton - - tekton-pipelines - scope: Namespaced diff --git a/docs/README.md b/docs/README.md index 049ca405eab..701d912921a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -72,7 +72,7 @@ See the following topics to learn how to use Tekton Pipelines in your project: - [Viewing logs](logs.md) - [Pipelines metrics](metrics.md) - [Variable Substitutions](tasks.md#using-variable-substitution) -- [Running a Custom Task (alpha)](runs.md) +- [Running a Custom Task](customruns.md) - [Remote resolution of Pipelines and Tasks](resolution.md) - [Trusted Resources](trusted-resources.md) diff --git a/docs/customruns.md b/docs/customruns.md index 72374f58b39..cf3f8014bca 100644 --- a/docs/customruns.md +++ b/docs/customruns.md @@ -26,7 +26,8 @@ weight: 206 # Overview -*We are promoting Custom Task from [`v1alpha1.Run`](runs.md) to `v1beta1.CustomRun`, please refer to the [migration doc](migrating-v1alpha1.Run-to-v1beta1.CustomRun.md) for details.* +*`v1beta1.CustomRun` has replaced `v1alpha1.Run` for custom task definitions. Please refer to the [migration doc](migrating-v1alpha1.Run-to-v1beta1.CustomRun.md) for details +on updating `v1alpha1.Run` to `v1beta1.CustomRun` before upgrading to a release that does not support `v1alpha1.Run`.* A `CustomRun` allows you to instantiate and execute a [Custom Task](https://github.com/tektoncd/community/blob/main/teps/0002-custom-tasks.md), diff --git a/docs/deprecations.md b/docs/deprecations.md index d8e6a7826c3..20b099ef354 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -31,10 +31,11 @@ The following features are deprecated but have not yet been removed. The features listed below have been removed but may still be supported in releases that have not reached their EOL. -| Removed Feature | Removal Pull Request | Removal Date | Latest Release with Support | EOL of Supported Release | +| Removed Feature | Removal Pull Request | Removal Date | Latest LTS Release with Support | EOL of Supported Release | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------------------------------|-------------------------------------| | [The `PipelineRun.Status.TaskRuns` and `PipelineRun.Status.Runs` fields and the `embedded-status` feature flag along with their functionalities have been tombstoned since v0.45.](https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md) | [[TEP100] Remove Taskruns and Runs Fields for PipelineRunStatus](https://github.com/tektoncd/pipeline/pull/6099) | Jan 25, 2023 | v0.44.0 | Jan 24, 2024 | | PipelineResources are removed, along with the components of the API that rely on them as proposed in [TEP-0074](https://github.com/tektoncd/community/blob/main/teps/0074-deprecate-pipelineresources.md). See [Removed `PipelineResources` related features](#removed-pipelineresources-related-features) for more info. | [[TEP074] Remove Generic PipelineResources with Rest of Resources Types](https://github.com/tektoncd/pipeline/pull/6150) | Mar 8, 2023 | v0.44.0 | Jan 24, 2024 | +| v1alpha1 Runs are removed, as proposed in [TEP-0114](https://github.com/tektoncd/community/blob/main/teps/0114-custom-tasks-beta.md). | [TEP-0114: Remove support for v1alpha1.Run](https://github.com/tektoncd/pipeline/pull/6508) | April 7, 2023 | v0.44.0 | Jan 24, 2024 | ### Removed PipelineResources related features: diff --git a/docs/pipelines.md b/docs/pipelines.md index 0a98ae3b589..e01cdf02a0d 100644 --- a/docs/pipelines.md +++ b/docs/pipelines.md @@ -1626,10 +1626,9 @@ Starting from `v0.47.0`, feature flag `custom-task-version` is removed and only can implement behavior that doesn't correspond directly to running a workload in a `Pod` on the cluster. For example, a custom task might execute some operation outside of the cluster and wait for its execution to complete. -A `PipelineRun` starts a custom task by creating a [`Run`](https://github.com/tektoncd/pipeline/blob/main/docs/runs.md)/[`CustomRun`](https://github.com/tektoncd/pipeline/blob/main/docs/customruns.md) instead of a `TaskRun`. +A `PipelineRun` starts a custom task by creating a [`CustomRun`](https://github.com/tektoncd/pipeline/blob/main/docs/customruns.md) instead of a `TaskRun`. In order for a custom task to execute, there must be a custom task controller running on the cluster -that is responsible for watching and updating `Run/CustomRun`s which reference their type. -If no such controller is running, those `Run/CustomRun`s will never complete and Pipelines using them will time out. +that is responsible for watching and updating `CustomRun`s which reference their type. ### Specifying the target Custom Task diff --git a/docs/runs.md b/docs/runs.md deleted file mode 100644 index c6d989d60d2..00000000000 --- a/docs/runs.md +++ /dev/null @@ -1,423 +0,0 @@ - - -# Runs - -- [Overview](#overview) -- [Configuring a `Run`](#configuring-a-run) - - [Specifying the target Custom Task](#specifying-the-target-custom-task) - - [Specifying Parameters](#specifying-parameters) - - [Specifying Workspaces, Service Account, and Pod Template](#specifying-workspaces-service-account-and-pod-template) -- [Monitoring execution status](#monitoring-execution-status) - - [Monitoring `Results`](#monitoring-results) -- [Code examples](#code-examples) - - [Example `Run` with a referenced custom task](#example-run-with-a-referenced-custom-task) - - [Example `Run` with an unnamed custom task](#example-run-with-an-unnamed-custom-task) - - [Example of specifying parameters](#example-of-specifying-parameters) - -# Overview - -*We are promoting Custom Task from `v1alpha1.Run` to [`v1beta1.CustomRun`](customruns.md), please refer to the [migration doc](migrating-v1alpha1.Run-to-v1beta1.CustomRun.md) for details.* - -A `Run` allows you to instantiate and execute a [Custom -Task](https://github.com/tektoncd/community/blob/main/teps/0002-custom-tasks.md), -which can be implemented by a custom task controller running on-cluster. Custom -Tasks can implement behavior that doesn't correspond directly to running a -workload in a `Pod` on the cluster. For Pod-based on-cluster workloads, you -should use a [`TaskRun`](taskruns.md). - -In order for a `Run` to actually execute, there must be a custom task -controller running on the cluster that is responsible for watching and updating -`Run`s which reference their type. If no such controller is running, `Run`s -will have no `.status` value and no further action will be taken. - -`Run`s are an **_experimental alpha feature_** and should be expected to change -in breaking ways or even be removed. - -## Configuring a `Run` - -A `Run` definition supports the following fields: - -- Required: - - [`apiVersion`][kubernetes-overview] - Specifies the API version, for example - `tekton.dev/v1beta1`. - - [`kind`][kubernetes-overview] - Identifies this resource object as a `Run` object. - - [`metadata`][kubernetes-overview] - Specifies the metadata that uniquely identifies the - `Run`, such as a `name`. - - [`spec`][kubernetes-overview] - Specifies the configuration for the `Run`. - - [`ref`](#1-specifying-the-target-custom-task-with-ref) - Specifies the type and - (optionally) name of the custom task type to execute. - - [`spec`](#2-specifying-the-target-custom-task-by-embedding-its-spec) - Embed the custom task resource spec - directly in a `Run`. -- Optional: - - [`params`](#specifying-parameters) - Specifies the desired execution - parameters for the custom task. - - [`serviceAccountName`](#specifying-a-serviceaccount) - Specifies a `ServiceAccount` - object that provides custom credentials for executing the `Run`. - - [`workspaces`](#specifying-workspaces) - Specifies the physical volumes to use for the - [`Workspaces`](workspaces.md) required by a custom task. - - [`podTemplate`](#specifying-a-pod-template) - Specifies a [`Pod` template](podtemplates.md) to use - to configure pods created by the custom task. - -[kubernetes-overview]: - https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields - -### Specifying the target Custom Task - -A custom task resource's `Spec` may be directly embedded in the `Run` or it may -be referred to by a `Ref`. But, not both at the same time. - -1. [Specifying the target Custom Task with ref](#1-specifying-the-target-custom-task-with-ref) - Referring a custom task (i.e. `Ref` ) promotes reuse of custom task definitions. - -2. [Specifying the target Custom Task by embedding its spec](#2-specifying-the-target-custom-task-by-embedding-its-spec) - Embedding a custom task (i.e. `Spec` ) helps in avoiding name collisions with other users within the same namespace. - Additionally, in a pipeline with multiple embedded custom tasks, the details of entire pipeline can be fetched in a - single API request. - -### 1. Specifying the target Custom Task with ref - -To specify the custom task type you want to execute in your `Run`, use the -`ref` field as shown below: - -```yaml -spec: - ref: - apiVersion: example.dev/v1alpha1 - kind: Example -``` - -This initiates the execution of a `Run` of a custom task of type `Example`, in -the `example.dev` API group, with the version `v1alpha1`. - -You can also specify the `name` and optional `namespace` (default is `default`) -of a custom task resource object previously defined in the cluster. - -```yaml -spec: - ref: - apiVersion: example.dev/v1alpha1 - kind: Example - name: my-example -``` - -If the `ref` specifies a name, the custom task controller should look up the -`Example` resource with that name, and use that object to configure the -execution. - -If the `ref` does not specify a name, the custom task controller might support -some default behavior for executing unnamed tasks. - -In either case, if the named resource cannot be found, or if unnamed tasks are -not supported, the custom task controller should update the `Run`'s status to -indicate the error. - -### 2. Specifying the target Custom Task by embedding its spec - -To specify the custom task spec, it can be embedded directly into a -`Run`'s spec as shown below: - -```yaml -apiVersion: tekton.dev/v1alpha1 -kind: Run -metadata: - name: embedded-run -spec: - spec: - apiVersion: example.dev/v1alpha1 - kind: Example - spec: - field1: value1 - field2: value2 -``` - -This initiates the execution of a `Run` of a custom task of type `Example`, in -the `example.dev` API group, with the version `v1alpha1`. - -#### Developer guide for custom controllers supporting `spec`. - -1. A custom controller may or may not support a `Spec`. In cases where it is - not supported the custom controller should respond with proper validation - error. - -2. Validation of the fields of the custom task is delegated to the custom - task controller. It is recommended to implement validations as asynchronous - (i.e. at reconcile time), rather than part of the webhook. Using a webhook - for validation is problematic because, it is not possible to filter custom - task resource objects before validation step, as a result each custom task - resource has to undergo validation by all the installed custom task - controllers. - -3. A custom task may have an empty spec, but cannot have an empty - `ApiVersion` and `Kind`. Custom task controllers should handle - an empty spec, either with a default behaviour, in a case no default - behaviour is supported then, appropriate validation error should be - updated to the `Run`'s status. - -### Specifying `Timeout` - -A custom task specification can be created with `Timeout` as follows: - -```yaml -apiVersion: tekton.dev/v1alpha1 -kind: Run -metadata: - generateName: simpleexample -spec: - timeout: 10s # set timeouts here. - params: - - name: searching - value: the purpose of my existence - ref: - apiVersion: custom.tekton.dev/v1alpha1 - kind: Example - name: exampleName -``` - -Supporting timeouts is optional but recommended. - -#### Developer guide for custom controllers supporting `Timeout` - -1. Tekton controllers will never directly update the status of the - `Run`, it is the responsibility of the custom task controller to support - timeout. If timeouts are not supported, it's the responsibility of the custom - task controller to reject `Run`s that specify a timeout value. -2. On a `pipelineRun` or `pipelineTask` timeout, the status of the - `Run.Spec.Status` is updated to `RunCancelled`. It is up to the custom task - controller to respond to it. An existing controller, which does not yet - support timeout, will be able to cleanup, if it supports a cancel. -3. A Custom Task author can watch for this status update - (i.e. `Run.Spec.Status == RunCancelled`) and or `Run.HasTimedOut()` and take - any corresponding actions (i.e. a clean up e.g., cancel a cloud build, stop - the waiting timer, tear down the approval listener). -4. A Custom Task author can differentiate between a Run cancelled by an user from a - Run cancellation initiated by a PipelineRun by looking at the `Run.Spec.StatusMessage`. - If a Run cancellation has been initiated by a cancellation of a PipelineRun then `Run.Spec.StatusMessage` is - `"Run cancelled as the PipelineRun it belongs to has been cancelled."`. -5. Once resources or timers are cleaned up it is good practice to set a - `conditions` on the `Run`'s `status` of `Succeeded/False` with a `Reason` - of `RunTimedOut`. - -### Specifying `Retries` - -A custom task specification can be created with `Retries` as follows: - -```yaml -apiVersion: tekton.dev/v1alpha1 -kind: Run -metadata: - generateName: simpleexample -spec: - retries: 3 # set retries - params: - - name: searching - value: the purpose of my existence - ref: - apiVersion: custom.tekton.dev/v1alpha1 - kind: Example - name: exampleName -``` - -Supporting retries is optional but recommended. - -#### Developer guide for custom controllers supporting `retries` - -1. Tekton controllers will use the entire `timeout` duration for exhausting - all the retries the custom task is configured to run with. In other words, - tekton does not discriminate, if the failure was due to a stuck up process or - exhausting all the retries. Custom task developers are recommended to use the - same strategy for implementing their timeout for the custom task. -2. Those custom task who do not wish to support retry, can simply ignore it. -3. It is recommended, that custom task should update the field `RetriesStatus` - of a `Run` on each retry performed by the custom task. -4. Tekton controller does not validate that number of entries in `RetriesStatus` - is same as specified value of retries count. - -### Specifying `Parameters` - -If a custom task supports [`parameters`](tasks.md#parameters), you can use the -`params` field in the `Run` to specify their values: - -```yaml -spec: - params: - - name: my-param - value: chicken -``` - -If the custom task controller knows how to interpret the parameter value, it -will do so. It might enforce that some parameter values must be specified, or -reject unknown parameter values. - -### Specifying Workspaces, Service Account, and Pod Template - -A `Run` object can specify workspaces, a service account name, or a pod template. -These are intended to be used with custom tasks that create Pods or other resources that embed a Pod specification. -The custom task can use these specifications to construct the Pod specification. -Not all custom tasks will support these values. -Consult the documentation of the custom task that you are using to determine whether these values apply. - -#### Specifying workspaces - -If the custom task supports it, you can provide [`Workspaces`](workspaces.md) to share data with the custom task. - -```yaml -spec: - workspaces: - - name: my-workspace - emptyDir: {} -``` - -Consult the documentation of the custom task that you are using to determine whether it supports workspaces and how to name them. - -#### Specifying a ServiceAccount - -If the custom task supports it, you can execute the `Run` with a specific set of credentials by -specifying a `ServiceAccount` object name in the `serviceAccountName` field in your `Run` -definition. If you do not explicitly specify this, the `Run` executes with the service account -specified in the `configmap-defaults` `ConfigMap`. If this default is not specified, `Runs` -will execute with the [`default` service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server) -set for the target [`namespace`](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/). - -```yaml -spec: - serviceAccountName: my-account -``` - -Consult the documentation of the custom task that you are using to determine whether it supports a service account name. - -#### Specifying a pod template - -If the custom task supports it, you can specify a [`Pod` template](podtemplates.md) configuration that the custom task will -use to configure Pods (or other resources that embed a Pod specification) that it creates. - -```yaml -spec: - podTemplate: - securityContext: - runAsUser: 1001 -``` - -Consult the documentation of the custom task that you are using to determine whether it supports a pod template. - -## Monitoring execution status - -As your `Run` executes, its `status` field accumulates information on the -execution of the `Run`. This information includes start and completion times, -and any output `results` reported by the custom task controller. - -The following example shows the `status` field of a `Run` that has executed -successfully: - -```yaml -completionTime: "2019-08-12T18:22:57Z" -conditions: - - lastTransitionTime: "2019-08-12T18:22:57Z" - message: Execution was successful - reason: Succeeded - status: "True" - type: Succeeded -startTime: "2019-08-12T18:22:51Z" -``` - -The following tables shows how to read the overall status of a `Run`: - -`status`|Description -:-------|-----------: -|The custom task controller has not taken any action on the Run. -Unknown|The custom task controller has started execution and the Run is ongoing. -True|The Run completed successfully. -False|The Run completed unsuccessfully. - -In any case, the custom task controller should populate the `reason` and -`message` fields to provide more information about the status of the execution. - -### Monitoring `Results` - -After the `Run` completes, the custom task controller can report output -values -in the `results` field: - -``` -results: -- name: my-result - value: chicken -``` - -## Code examples - -To better understand `Runs`, study the following code examples: - -- [Example `Run` with a referenced custom task](#example-run-with-a-referenced-custom-task) -- [Example `Run` with an unnamed custom task](#example-run-with-an-unnamed-custom-task) -- [Example of specifying parameters](#example-of-specifying-parameters) - -### Example `Run` with a referenced custom task - -In this example, a `Run` named `my-example-run` invokes a custom task of the `v1alpha1` -version of the `Example` kind in the `example.dev` API group, with the name -`my-example-task`. - -In this case the custom task controller is expected to look up the `Example` -resource named `my-example-task` and to use that configuration to configure the -execution of the `Run`. - -```yaml -apiVersion: tekton.dev/v1alpha1 -kind: Run -metadata: - name: my-example-run -spec: - ref: - apiVersion: example.dev/v1alpha1 - kind: Example - name: my-example-task -``` - -### Example `Run` with an unnamed custom task - -In this example, a `Run` named `my-example-run` invokes a custom task of the `v1alpha1` -version of the `Example` kind in the `example.dev` API group, without a specified name. - -In this case the custom task controller is expected to provide some default -behavior when the referenced task is unnamed. - -```yaml -apiVersion: tekton.dev/v1alpha1 -kind: Run -metadata: - name: my-example-run -spec: - ref: - apiVersion: example.dev/v1alpha1 - kind: Example -``` - -### Example of specifying parameters - -In this example, a `Run` named `my-example-run` invokes a custom task, and -specifies some parameter values to further configure the execution's behavior. - -In this case the custom task controller is expected to validate and interpret -these parameter values and use them to configure the `Run`'s execution. - -```yaml -apiVersion: tekton.dev/v1alpha1 -kind: Run -metadata: - name: my-example-run -spec: - ref: - apiVersion: example.dev/v1alpha1 - kind: Example - name: my-example-task - params: - - name: my-first-param - value: i'm number one - - name: my-second-param - value: close second -``` diff --git a/pkg/controller/filter.go b/pkg/controller/filter.go index 2a3674b40c9..316734361cf 100644 --- a/pkg/controller/filter.go +++ b/pkg/controller/filter.go @@ -20,93 +20,11 @@ package controller import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - listersalpha "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha1" listersbeta "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// FilterRunRef returns a filter that can be passed to a Run Informer, which -// filters out Runs for apiVersion and kinds that a controller doesn't care -// about. -// -// For example, a controller impl that wants to be notified of updates to Runs -// which reference a Task with apiVersion "example.dev/v0" and kind "Example": -// -// runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{ -// FilterFunc: FilterRunRef("example.dev/v0", "Example"), -// Handler: controller.HandleAll(impl.Enqueue), -// }) -func FilterRunRef(apiVersion, kind string) func(interface{}) bool { - return func(obj interface{}) bool { - r, ok := obj.(*v1alpha1.Run) - if !ok { - // Somehow got informed of a non-Run object. - // Ignore. - return false - } - if r == nil || (r.Spec.Ref == nil && r.Spec.Spec == nil) { - // These are invalid, but just in case they get - // created somehow, don't panic. - return false - } - result := false - if r.Spec.Ref != nil { - result = r.Spec.Ref.APIVersion == apiVersion && r.Spec.Ref.Kind == v1beta1.TaskKind(kind) - } else if r.Spec.Spec != nil { - result = r.Spec.Spec.APIVersion == apiVersion && r.Spec.Spec.Kind == kind - } - return result - } -} - -// FilterOwnerRunRef returns a filter that can be passed to an Informer for any runtime object, which -// filters out objects that aren't controlled by a Run that references a particular apiVersion and kind. -// -// For example, a controller impl that wants to be notified of updates to TaskRuns that are controlled by -// a Run which references a custom task with apiVersion "example.dev/v0" and kind "Example": -// -// taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{ -// FilterFunc: FilterOwnerRunRef("example.dev/v0", "Example"), -// Handler: controller.HandleAll(impl.Enqueue), -// }) -func FilterOwnerRunRef(runLister listersalpha.RunLister, apiVersion, kind string) func(interface{}) bool { - return func(obj interface{}) bool { - object, ok := obj.(metav1.Object) - if !ok { - return false - } - owner := metav1.GetControllerOf(object) - if owner == nil { - return false - } - if owner.APIVersion != v1alpha1.SchemeGroupVersion.String() || owner.Kind != pipeline.RunControllerName { - // Not owned by a Run - return false - } - run, err := runLister.Runs(object.GetNamespace()).Get(owner.Name) - if err != nil { - return false - } - if run.Spec.Ref == nil && run.Spec.Spec == nil { - // These are invalid, but just in case they get created somehow, don't panic. - return false - } - if run.Spec.Ref != nil && run.Spec.Spec != nil { - // These are invalid. - return false - } - result := false - if run.Spec.Ref != nil { - result = run.Spec.Ref.APIVersion == apiVersion && run.Spec.Ref.Kind == v1beta1.TaskKind(kind) - } else if run.Spec.Spec != nil { - result = run.Spec.Spec.APIVersion == apiVersion && run.Spec.Spec.Kind == kind - } - return result - } -} - // FilterCustomRunRef returns a filter that can be passed to a CustomRun Informer, which // filters out CustomRuns for apiVersion and kinds that a controller doesn't care // about. diff --git a/pkg/controller/filter_test.go b/pkg/controller/filter_test.go index fb9729958ae..eda3f7c21c7 100644 --- a/pkg/controller/filter_test.go +++ b/pkg/controller/filter_test.go @@ -22,7 +22,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - fakeruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/run/fake" fakecustomruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/fake" "github.com/tektoncd/pipeline/pkg/controller" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -39,445 +38,6 @@ const ( var trueB = true -func TestFilterRunRef(t *testing.T) { - for _, c := range []struct { - desc string - in interface{} - want bool - }{{ - desc: "not a Run", - in: struct{}{}, - want: false, - }, { - desc: "nil Run", - in: (*v1alpha1.Run)(nil), - want: false, - }, { - desc: "nil ref and spec", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Ref: nil, - Spec: nil, - }, - }, - want: false, - }, { - desc: "both ref and spec", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: "not-matching", - Kind: kind, - }, - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion, - Kind: kind, - }, - }, - }, - }, - want: false, - }, { - desc: "Run without matching apiVersion in taskRef", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: "not-matching", - Kind: kind, - }, - }, - }, - want: false, - }, { - desc: "Run without matching kind in taskRef", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion, - Kind: "not-matching", - }, - }, - }, - want: false, - }, { - desc: "Run with matching apiVersion and kind in taskRef", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion, - Kind: kind, - }, - }, - }, - want: true, - }, { - desc: "Run with matching apiVersion and kind in taskSpec", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion, - Kind: kind, - }, - }, - }, - }, - want: true, - }, { - desc: "Run without matching kind for taskSpec", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion, - Kind: "not-matching", - }, - }, - }, - }, - want: false, - }, { - desc: "Run without matching apiVersion for taskSpec", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: "not-matching", - Kind: kind, - }, - }, - }, - }, - want: false, - }, { - desc: "Run with matching apiVersion and kind and name for taskRef", - in: &v1alpha1.Run{ - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion, - Kind: kind, - Name: "some-name", - }, - }, - }, - want: true, - }} { - t.Run(c.desc, func(t *testing.T) { - got := controller.FilterRunRef(apiVersion, kind)(c.in) - if got != c.want { - t.Fatalf("FilterRunRef(%q, %q) got %t, want %t", apiVersion, kind, got, c.want) - } - }) - } -} - -func TestFilterOwnerRunRef(t *testing.T) { - for _, c := range []struct { - desc string - in interface{} - owner *v1alpha1.Run - want bool - }{{ - desc: "Owner is a Run for taskRef that references a matching apiVersion and kind", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-run", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-run", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion, - Kind: kind, - }, - }, - }, - want: true, - }, { - desc: "Owner is a Run for taskSpec that references a matching apiVersion and kind", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-run", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-run", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion, - Kind: kind, - }, - }, - }, - }, - want: true, - }, { - desc: "Owner is a Run for taskRef that references a non-matching apiversion", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-other-run", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-other-run", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion2, // different apiversion - Kind: kind, - }, - }, - }, - want: false, - }, { - desc: "Owner is a Run for taskSpec that references a non-matching apiversion", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-other-run", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-other-run", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion2, - Kind: kind, - }, - }, - }, - }, - want: false, - }, { - desc: "Owner is a Run for taskRef that references a non-matching kind", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-other-run2", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-other-run2", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion, - Kind: kind2, // different kind - }, - }, - }, - want: false, - }, { - desc: "Owner is a Run for taskSpec that references a non-matching kind", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-other-run2", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-other-run2", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion, - Kind: kind2, - }, - }, - }, - }, - want: false, - }, { - desc: "Owner is a Run with a missing ref and spec", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-strange-run", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-strange-run", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{}, // missing ref (illegal) - }, - want: false, - }, { - desc: "Owner is a Run with both ref and spec with matching apiversion and kind", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - Name: "some-strange-run", - Controller: &trueB, - }}, - }, - }, - owner: &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.RunControllerName, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "some-strange-run", - Namespace: "default", - }, - Spec: v1alpha1.RunSpec{ - Ref: &v1beta1.TaskRef{ - APIVersion: apiVersion, - Kind: kind, - }, - Spec: &v1alpha1.EmbeddedRunSpec{ - TypeMeta: runtime.TypeMeta{ - APIVersion: apiVersion, - Kind: kind, - }, - }, - }, - }, - want: false, - }, { - desc: "Owner is not a Run", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun", - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: pipeline.PipelineRunControllerName, // owned by PipelineRun, not Run - Name: "some-pipelinerun", - Controller: &trueB, - }}, - }, - }, - want: false, - }, { - desc: "Object has no owner", - in: &v1beta1.TaskRun{ - ObjectMeta: metav1.ObjectMeta{ - Name: "some-taskrun-no-owner", - Namespace: "default", - }, - }, - want: false, - }, { - desc: "input is not a runtime Object", - in: struct{}{}, - want: false, - }} { - t.Run(c.desc, func(t *testing.T) { - ctx, _ := rtesting.SetupFakeContext(t) - runInformer := fakeruninformer.Get(ctx) - if c.owner != nil { - if err := runInformer.Informer().GetIndexer().Add(c.owner); err != nil { - t.Fatal(err) - } - } - got := controller.FilterOwnerRunRef(runInformer.Lister(), apiVersion, kind)(c.in) - if got != c.want { - t.Fatalf("FilterOwnerRunRef(%q, %q) got %t, want %t", apiVersion, kind, got, c.want) - } - }) - } -} - func TestFilterCustomRunRef(t *testing.T) { for _, c := range []struct { desc string diff --git a/pkg/reconciler/events/cache/cache.go b/pkg/reconciler/events/cache/cache.go index beb49629a06..2a7a9fb8e5c 100644 --- a/pkg/reconciler/events/cache/cache.go +++ b/pkg/reconciler/events/cache/cache.go @@ -23,13 +23,11 @@ import ( cloudevents "github.com/cloudevents/sdk-go/v2" lru "github.com/hashicorp/golang-lru" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) // Struct to unmarshal the event data type eventData struct { - Run *v1alpha1.Run `json:"run,omitempty"` CustomRun *v1beta1.CustomRun `json:"customRun,omitempty"` } @@ -59,18 +57,12 @@ func EventKey(event *cloudevents.Event) (string, error) { if err != nil { return "", err } - if data.Run == nil && data.CustomRun == nil { - return "", fmt.Errorf("Invalid Run data in %v", event) - } - if data.Run != nil { - resourceName = data.Run.Name - resourceNamespace = data.Run.Namespace - resourceKind = "run" - } else { - resourceName = data.CustomRun.Name - resourceNamespace = data.CustomRun.Namespace - resourceKind = "customrun" + if data.CustomRun == nil { + return "", fmt.Errorf("Invalid CustomRun data in %v", event) } + resourceName = data.CustomRun.Name + resourceNamespace = data.CustomRun.Namespace + resourceKind = "customrun" eventType := event.Type() return fmt.Sprintf("%s/%s/%s/%s", eventType, resourceKind, resourceNamespace, resourceName), nil } diff --git a/pkg/reconciler/events/cache/cache_test.go b/pkg/reconciler/events/cache/cache_test.go index 4ae12beab5f..3efaf84139c 100644 --- a/pkg/reconciler/events/cache/cache_test.go +++ b/pkg/reconciler/events/cache/cache_test.go @@ -26,7 +26,6 @@ import ( cetypes "github.com/cloudevents/sdk-go/v2/types" "github.com/google/go-cmp/cmp" lru "github.com/hashicorp/golang-lru" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/diff" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -36,9 +35,6 @@ func strptr(s string) *string { return &s } func getEventData(run interface{}) map[string]interface{} { cloudEventData := map[string]interface{}{} - if v, ok := run.(*v1alpha1.Run); ok { - cloudEventData["run"] = v - } if v, ok := run.(*v1beta1.CustomRun); ok { cloudEventData["customRun"] = v } @@ -61,21 +57,6 @@ func getEventToTest(eventtype string, run interface{}) *event.Event { return &e } -func getRunByMeta(name string, namespace string) *v1alpha1.Run { - return &v1alpha1.Run{ - TypeMeta: metav1.TypeMeta{ - Kind: "Run", - APIVersion: "v1alpha1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: v1alpha1.RunSpec{}, - Status: v1alpha1.RunStatus{}, - } -} - func getCustomRunByMeta(name string, namespace string) *v1beta1.CustomRun { return &v1beta1.CustomRun{ TypeMeta: metav1.TypeMeta{ @@ -100,12 +81,6 @@ func TestEventsKey(t *testing.T) { wantKey string wantErr bool }{{ - name: "run event", - eventtype: "my.test.run.event", - run: getRunByMeta("myrun", "mynamespace"), - wantKey: "my.test.run.event/run/mynamespace/myrun", - wantErr: false, - }, { name: "customrun event", eventtype: "my.test.run.event", run: getCustomRunByMeta("myrun", "mynamespace"), @@ -136,10 +111,9 @@ func TestEventsKey(t *testing.T) { } func TestAddCheckEvent(t *testing.T) { - run := getRunByMeta("arun", "anamespace") - runb := getRunByMeta("arun", "bnamespace") - customRun := getCustomRunByMeta("arun", "anamespace") - baseEvent := getEventToTest("some.event.type", run) + customRun1 := getCustomRunByMeta("arun", "anamespace") + customRun2 := getCustomRunByMeta("arun", "bnamespace") + baseEvent := getEventToTest("some.event.type", customRun1) testcases := []struct { name string @@ -154,22 +128,17 @@ func TestAddCheckEvent(t *testing.T) { }, { name: "new timestamp event", firstEvent: baseEvent, - secondEvent: getEventToTest("some.event.type", run), + secondEvent: getEventToTest("some.event.type", customRun1), wantFound: true, }, { name: "different namespace", firstEvent: baseEvent, - secondEvent: getEventToTest("some.event.type", runb), - wantFound: false, - }, { - name: "customrun instead of run", - firstEvent: baseEvent, - secondEvent: getEventToTest("some.event.type", customRun), + secondEvent: getEventToTest("some.event.type", customRun2), wantFound: false, }, { name: "different event type", firstEvent: baseEvent, - secondEvent: getEventToTest("some.other.event.type", run), + secondEvent: getEventToTest("some.other.event.type", customRun1), wantFound: false, }} diff --git a/pkg/reconciler/events/cloudevent/cloud_event_controller.go b/pkg/reconciler/events/cloudevent/cloud_event_controller.go index 6e5b403fc19..8ea38463f53 100644 --- a/pkg/reconciler/events/cloudevent/cloud_event_controller.go +++ b/pkg/reconciler/events/cloudevent/cloud_event_controller.go @@ -24,7 +24,6 @@ import ( cloudevents "github.com/cloudevents/sdk-go/v2" lru "github.com/hashicorp/golang-lru" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/events/cache" corev1 "k8s.io/api/core/v1" @@ -95,10 +94,9 @@ func SendCloudEventWithRetries(ctx context.Context, object runtime.Object) error if err != nil { return err } - // Events for Runs require a cache of events that have been sent - _, isRun := object.(*v1alpha1.Run) + // Events for CustomRuns require a cache of events that have been sent _, isCustomRun := object.(*v1beta1.CustomRun) - if isRun || isCustomRun { + if isCustomRun { cacheClient = cache.Get(ctx) } @@ -110,7 +108,7 @@ func SendCloudEventWithRetries(ctx context.Context, object runtime.Object) error wasIn <- nil logger.Debugf("Sending cloudevent of type %q", event.Type()) // In case of Run event, check cache if cloudevent is already sent - if isRun || isCustomRun { + if isCustomRun { cloudEventSent, err := cache.ContainsOrAddCloudEvent(cacheClient, event) if err != nil { logger.Errorf("error while checking cache: %s", err) diff --git a/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go b/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go index d9771670038..b963a7f86b0 100644 --- a/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go +++ b/pkg/reconciler/events/cloudevent/cloud_event_controller_test.go @@ -22,7 +22,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" "github.com/tektoncd/pipeline/pkg/reconciler/events/k8sevent" @@ -87,14 +86,6 @@ func TestSendCloudEventWithRetries(t *testing.T) { }, wantCEvents: []string{}, wantEvents: []string{"Warning Cloud Event Failure"}, - }, { - name: "test-send-cloud-event-run", - clientBehaviour: cloudevent.FakeClientBehaviour{ - SendSuccessfully: true, - }, - object: &v1alpha1.Run{}, - wantCEvents: []string{"Context Attributes,"}, - wantEvents: []string{}, }, { name: "test-send-cloud-event-customrun", clientBehaviour: cloudevent.FakeClientBehaviour{ @@ -168,11 +159,11 @@ func TestSendCloudEventWithRetriesNoClient(t *testing.T) { } func TestEmitCloudEvents(t *testing.T) { - object := &v1alpha1.Run{ + object := &v1beta1.CustomRun{ ObjectMeta: metav1.ObjectMeta{ - SelfLink: "/run/test1", + SelfLink: "/customrun/test1", }, - Status: v1alpha1.RunStatus{}, + Status: v1beta1.CustomRunStatus{}, } testcases := []struct { name string @@ -193,7 +184,7 @@ func TestEmitCloudEvents(t *testing.T) { name: "with sink", data: map[string]string{"default-cloud-events-sink": "http://mysink"}, wantEvents: []string{}, - wantCloudEvents: []string{`(?s)dev.tekton.event.run.started.v1.*test1`}, + wantCloudEvents: []string{`(?s)dev.tekton.event.customrun.started.v1.*test1`}, }} for _, tc := range testcases { diff --git a/pkg/reconciler/events/cloudevent/cloudevent.go b/pkg/reconciler/events/cloudevent/cloudevent.go index 8cefaf54392..3455782d30c 100644 --- a/pkg/reconciler/events/cloudevent/cloudevent.go +++ b/pkg/reconciler/events/cloudevent/cloudevent.go @@ -25,7 +25,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/google/uuid" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -60,16 +59,6 @@ const ( PipelineRunSuccessfulEventV1 TektonEventType = "dev.tekton.event.pipelinerun.successful.v1" // PipelineRunFailedEventV1 is sent for PipelineRuns with "ConditionSucceeded" "False" PipelineRunFailedEventV1 TektonEventType = "dev.tekton.event.pipelinerun.failed.v1" - // RunStartedEventV1 is sent for Runs with "ConditionSucceeded" "Unknown" - // the first time they are picked up by the reconciler - RunStartedEventV1 TektonEventType = "dev.tekton.event.run.started.v1" - // RunRunningEventV1 is sent for Runs with "ConditionSucceeded" "Unknown" - // once the Run is validated and Pod created - RunRunningEventV1 TektonEventType = "dev.tekton.event.run.running.v1" - // RunSuccessfulEventV1 is sent for Runs with "ConditionSucceeded" "True" - RunSuccessfulEventV1 TektonEventType = "dev.tekton.event.run.successful.v1" - // RunFailedEventV1 is sent for Runs with "ConditionSucceeded" "False" - RunFailedEventV1 TektonEventType = "dev.tekton.event.run.failed.v1" // CustomRunStartedEventV1 is sent for CustomRuns with "ConditionSucceeded" "Unknown" // the first time they are picked up by the reconciler CustomRunStartedEventV1 TektonEventType = "dev.tekton.event.customrun.started.v1" @@ -101,7 +90,6 @@ type CEClient interface { type TektonCloudEventData struct { TaskRun *v1beta1.TaskRun `json:"taskRun,omitempty"` PipelineRun *v1beta1.PipelineRun `json:"pipelineRun,omitempty"` - Run *v1alpha1.Run `json:"run,omitempty"` CustomRun *v1beta1.CustomRun `json:"customRun,omitempty"` } @@ -113,8 +101,6 @@ func newTektonCloudEventData(runObject objectWithCondition) TektonCloudEventData tektonCloudEventData.TaskRun = v case *v1beta1.PipelineRun: tektonCloudEventData.PipelineRun = v - case *v1alpha1.Run: - tektonCloudEventData.Run = v case *v1beta1.CustomRun: tektonCloudEventData.CustomRun = v } @@ -162,9 +148,6 @@ func getEventType(runObject objectWithCondition) (*TektonEventType, error) { // picked up by the `Run` reconciler. In that case we consider the run // as started. In all other cases, conditions have to be initialised switch runObject.(type) { - case *v1alpha1.Run: - eventType = RunStartedEventV1 - return &eventType, nil case *v1beta1.CustomRun: eventType = CustomRunStartedEventV1 return &eventType, nil @@ -193,11 +176,7 @@ func getEventType(runObject objectWithCondition) (*TektonEventType, error) { default: eventType = PipelineRunUnknownEventV1 } - case *v1alpha1.Run: - // Run controller have the freedom of setting reasons as they wish - // so we cannot make many assumptions here. If a condition is set - // to unknown (not finished), we sent the running event - eventType = RunRunningEventV1 + case *v1beta1.CustomRun: // CustomRun controller have the freedom of setting reasons as they wish // so we cannot make many assumptions here. If a condition is set @@ -210,8 +189,6 @@ func getEventType(runObject objectWithCondition) (*TektonEventType, error) { eventType = TaskRunFailedEventV1 case *v1beta1.PipelineRun: eventType = PipelineRunFailedEventV1 - case *v1alpha1.Run: - eventType = RunFailedEventV1 case *v1beta1.CustomRun: eventType = CustomRunFailedEventV1 } @@ -221,8 +198,6 @@ func getEventType(runObject objectWithCondition) (*TektonEventType, error) { eventType = TaskRunSuccessfulEventV1 case *v1beta1.PipelineRun: eventType = PipelineRunSuccessfulEventV1 - case *v1alpha1.Run: - eventType = RunSuccessfulEventV1 case *v1beta1.CustomRun: eventType = CustomRunSuccessfulEventV1 } diff --git a/pkg/reconciler/events/cloudevent/interface.go b/pkg/reconciler/events/cloudevent/interface.go index cd02c72c57d..b27026c9ba0 100644 --- a/pkg/reconciler/events/cloudevent/interface.go +++ b/pkg/reconciler/events/cloudevent/interface.go @@ -22,7 +22,7 @@ import ( "knative.dev/pkg/apis" ) -// objectWithCondition is implemented by TaskRun, PipelineRun and Run +// objectWithCondition is implemented by TaskRun, PipelineRun and CustomRun type objectWithCondition interface { // Object requires GetObjectKind() and DeepCopyObject() runtime.Object diff --git a/pkg/reconciler/pipelinerun/cancel.go b/pkg/reconciler/pipelinerun/cancel.go index 2f0c1f94169..907e4882ba2 100644 --- a/pkg/reconciler/pipelinerun/cancel.go +++ b/pkg/reconciler/pipelinerun/cancel.go @@ -24,7 +24,6 @@ import ( "strings" "time" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" "go.uber.org/zap" @@ -37,7 +36,7 @@ import ( "knative.dev/pkg/apis" ) -var cancelTaskRunPatchBytes, cancelCustomRunPatchBytes, cancelRunPatchBytes []byte +var cancelTaskRunPatchBytes, cancelCustomRunPatchBytes []byte func init() { var err error @@ -69,20 +68,6 @@ func init() { if err != nil { log.Fatalf("failed to marshal CustomRun cancel patch bytes: %v", err) } - cancelRunPatchBytes, err = json.Marshal([]jsonpatch.JsonPatchOperation{ - { - Operation: "add", - Path: "/spec/status", - Value: v1alpha1.RunSpecStatusCancelled, - }, - { - Operation: "add", - Path: "/spec/statusMessage", - Value: v1alpha1.RunCancelledByPipelineMsg, - }}) - if err != nil { - log.Fatalf("failed to marshal Run cancel patch bytes: %v", err) - } } func cancelCustomRun(ctx context.Context, runName string, namespace string, clientSet clientset.Interface) error { @@ -95,16 +80,6 @@ func cancelCustomRun(ctx context.Context, runName string, namespace string, clie return err } -func cancelRun(ctx context.Context, runName string, namespace string, clientSet clientset.Interface) error { - _, err := clientSet.TektonV1alpha1().Runs(namespace).Patch(ctx, runName, types.JSONPatchType, cancelRunPatchBytes, metav1.PatchOptions{}, "") - if errors.IsNotFound(err) { - // The resource may have been deleted in the meanwhile, but we should - // still be able to cancel the PipelineRun - return nil - } - return err -} - func cancelTaskRun(ctx context.Context, taskRunName string, namespace string, clientSet clientset.Interface) error { _, err := clientSet.TektonV1beta1().TaskRuns(namespace).Patch(ctx, taskRunName, types.JSONPatchType, cancelTaskRunPatchBytes, metav1.PatchOptions{}, "") if errors.IsNotFound(err) { @@ -154,7 +129,7 @@ func cancelPipelineTaskRuns(ctx context.Context, logger *zap.SugaredLogger, pr * func cancelPipelineTaskRunsForTaskNames(ctx context.Context, logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, clientSet clientset.Interface, taskNames sets.String) []string { errs := []string{} - trNames, customRunNames, runNames, err := getChildObjectsFromPRStatusForTaskNames(ctx, pr.Status, taskNames) + trNames, customRunNames, err := getChildObjectsFromPRStatusForTaskNames(ctx, pr.Status, taskNames) if err != nil { errs = append(errs, err.Error()) } @@ -176,25 +151,14 @@ func cancelPipelineTaskRunsForTaskNames(ctx context.Context, logger *zap.Sugared continue } } - - for _, runName := range runNames { - logger.Infof("cancelling Run %s", runName) - - if err := cancelRun(ctx, runName, pr.Namespace, clientSet); err != nil { - errs = append(errs, fmt.Errorf("Failed to patch Run `%s` with cancellation: %w", runName, err).Error()) - continue - } - } - return errs } -// getChildObjectsFromPRStatusForTaskNames returns taskruns, customruns, and runs in the PipelineRunStatus's ChildReferences, +// getChildObjectsFromPRStatusForTaskNames returns taskruns and customruns in the PipelineRunStatus's ChildReferences, // based on the given set of PipelineTask names. If that set is empty, all are returned. -func getChildObjectsFromPRStatusForTaskNames(ctx context.Context, prs v1beta1.PipelineRunStatus, taskNames sets.String) ([]string, []string, []string, error) { +func getChildObjectsFromPRStatusForTaskNames(ctx context.Context, prs v1beta1.PipelineRunStatus, taskNames sets.String) ([]string, []string, error) { var trNames []string var customRunNames []string - var runNames []string unknownChildKinds := make(map[string]string) for _, cr := range prs.ChildReferences { @@ -202,8 +166,6 @@ func getChildObjectsFromPRStatusForTaskNames(ctx context.Context, prs v1beta1.Pi switch cr.Kind { case taskRun: trNames = append(trNames, cr.Name) - case run: - runNames = append(runNames, cr.Name) case customRun: customRunNames = append(customRunNames, cr.Name) default: @@ -217,7 +179,7 @@ func getChildObjectsFromPRStatusForTaskNames(ctx context.Context, prs v1beta1.Pi err = fmt.Errorf("found child objects of unknown kinds: %v", unknownChildKinds) } - return trNames, customRunNames, runNames, err + return trNames, customRunNames, err } // gracefullyCancelPipelineRun marks any non-final resolved TaskRun(s) as cancelled and runs finally. diff --git a/pkg/reconciler/pipelinerun/cancel_test.go b/pkg/reconciler/pipelinerun/cancel_test.go index 0f024c2de81..b87d7bb7a5e 100644 --- a/pkg/reconciler/pipelinerun/cancel_test.go +++ b/pkg/reconciler/pipelinerun/cancel_test.go @@ -22,7 +22,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" _ "github.com/tektoncd/pipeline/pkg/pipelinerunmetrics/fake" // Make sure the pipelinerunmetrics are setup ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" @@ -41,7 +40,6 @@ func TestCancelPipelineRun(t *testing.T) { pipelineRun *v1beta1.PipelineRun taskRuns []*v1beta1.TaskRun - runs []*v1alpha1.Run customRuns []*v1beta1.CustomRun wantErr bool }{{ @@ -161,7 +159,7 @@ func TestCancelPipelineRun(t *testing.T) { {ObjectMeta: metav1.ObjectMeta{Name: "t1"}}, }, }, { - name: "multiple-taskruns-and-runs", + name: "multiple-taskruns-and-customruns", pipelineRun: &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "test-pipeline-run-cancelled"}, Spec: v1beta1.PipelineRunSpec{ @@ -180,12 +178,12 @@ func TestCancelPipelineRun(t *testing.T) { PipelineTaskName: "task-2", }, { - TypeMeta: runtime.TypeMeta{Kind: run}, + TypeMeta: runtime.TypeMeta{Kind: customRun}, Name: "r1", PipelineTaskName: "run-1", }, { - TypeMeta: runtime.TypeMeta{Kind: run}, + TypeMeta: runtime.TypeMeta{Kind: customRun}, Name: "r2", PipelineTaskName: "run-2", }, @@ -196,7 +194,7 @@ func TestCancelPipelineRun(t *testing.T) { {ObjectMeta: metav1.ObjectMeta{Name: "t1"}}, {ObjectMeta: metav1.ObjectMeta{Name: "t2"}}, }, - runs: []*v1alpha1.Run{ + customRuns: []*v1beta1.CustomRun{ {ObjectMeta: metav1.ObjectMeta{Name: "r1"}}, {ObjectMeta: metav1.ObjectMeta{Name: "r2"}}, }, @@ -220,12 +218,12 @@ func TestCancelPipelineRun(t *testing.T) { PipelineTaskName: "task-2", }, { - TypeMeta: runtime.TypeMeta{Kind: run}, + TypeMeta: runtime.TypeMeta{Kind: customRun}, Name: "r1", PipelineTaskName: "run-1", }, { - TypeMeta: runtime.TypeMeta{Kind: run}, + TypeMeta: runtime.TypeMeta{Kind: customRun}, Name: "r2", PipelineTaskName: "run-2", }, @@ -235,7 +233,7 @@ func TestCancelPipelineRun(t *testing.T) { taskRuns: []*v1beta1.TaskRun{ {ObjectMeta: metav1.ObjectMeta{Name: "t2"}}, }, - runs: []*v1alpha1.Run{ + customRuns: []*v1beta1.CustomRun{ {ObjectMeta: metav1.ObjectMeta{Name: "r1"}}, }, }, { @@ -301,7 +299,6 @@ func TestCancelPipelineRun(t *testing.T) { d := test.Data{ PipelineRuns: []*v1beta1.PipelineRun{tc.pipelineRun}, TaskRuns: tc.taskRuns, - Runs: tc.runs, CustomRuns: tc.customRuns, } ctx, _ := ttesting.SetupFakeContext(t) @@ -340,21 +337,6 @@ func TestCancelPipelineRun(t *testing.T) { } } } - if tc.runs != nil { - for _, expectedRun := range tc.runs { - r, err := c.Pipeline.TektonV1alpha1().Runs("").Get(ctx, expectedRun.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("couldn't get expected Run %s, got error %s", expectedRun.Name, err) - } - if r.Spec.Status != v1alpha1.RunSpecStatusCancelled { - t.Errorf("expected task %q to be marked as cancelled, was %q", r.Name, r.Spec.Status) - } - expectedStatusMessage := v1alpha1.RunCancelledByPipelineMsg - if r.Spec.StatusMessage != expectedStatusMessage { - t.Errorf("expected task %q to have status message %s but was %s", r.Name, expectedStatusMessage, r.Spec.StatusMessage) - } - } - } if tc.customRuns != nil { for _, expectedCustomRun := range tc.customRuns { cr, err := c.Pipeline.TektonV1beta1().CustomRuns("").Get(ctx, expectedCustomRun.Name, metav1.GetOptions{}) @@ -378,67 +360,49 @@ func TestCancelPipelineRun(t *testing.T) { func TestGetChildObjectsFromPRStatusForTaskNames(t *testing.T) { testCases := []struct { name string - useV1Beta1CustomTask bool prStatus v1beta1.PipelineRunStatus taskNames sets.String expectedTRNames []string expectedRunNames []string expectedCustomRunNames []string hasError bool - }{ - { - name: "runs", - prStatus: v1beta1.PipelineRunStatus{PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ - ChildReferences: []v1beta1.ChildStatusReference{{ - TypeMeta: runtime.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: run, - }, - Name: "r1", - PipelineTaskName: "run-1", - }}, - }}, - expectedTRNames: nil, - expectedRunNames: []string{"r1"}, - hasError: false, - }, { - name: "beta custom tasks", - useV1Beta1CustomTask: true, - prStatus: v1beta1.PipelineRunStatus{PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ - ChildReferences: []v1beta1.ChildStatusReference{{ - TypeMeta: runtime.TypeMeta{ - APIVersion: v1beta1.SchemeGroupVersion.String(), - Kind: customRun, - }, - Name: "r1", - PipelineTaskName: "run-1", - }}, + }{{ + name: "beta custom tasks", + prStatus: v1beta1.PipelineRunStatus{PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ + ChildReferences: []v1beta1.ChildStatusReference{{ + TypeMeta: runtime.TypeMeta{ + APIVersion: v1beta1.SchemeGroupVersion.String(), + Kind: customRun, + }, + Name: "r1", + PipelineTaskName: "run-1", }}, - expectedCustomRunNames: []string{"r1"}, - hasError: false, - }, { - name: "unknown kind", - prStatus: v1beta1.PipelineRunStatus{PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ - ChildReferences: []v1beta1.ChildStatusReference{{ - TypeMeta: runtime.TypeMeta{ - APIVersion: "v1", - Kind: "UnknownKind", - }, - Name: "u1", - PipelineTaskName: "unknown-1", - }}, + }}, + expectedCustomRunNames: []string{"r1"}, + hasError: false, + }, { + name: "unknown kind", + prStatus: v1beta1.PipelineRunStatus{PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ + ChildReferences: []v1beta1.ChildStatusReference{{ + TypeMeta: runtime.TypeMeta{ + APIVersion: "v1", + Kind: "UnknownKind", + }, + Name: "u1", + PipelineTaskName: "unknown-1", }}, - expectedTRNames: nil, - expectedRunNames: nil, - expectedCustomRunNames: nil, - hasError: true, - }, + }}, + expectedTRNames: nil, + expectedRunNames: nil, + expectedCustomRunNames: nil, + hasError: true, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ctx, _ := ttesting.SetupFakeContext(t) - trNames, customRunNames, runNames, err := getChildObjectsFromPRStatusForTaskNames(ctx, tc.prStatus, tc.taskNames) + trNames, customRunNames, err := getChildObjectsFromPRStatusForTaskNames(ctx, tc.prStatus, tc.taskNames) if tc.hasError { if err == nil { @@ -451,9 +415,6 @@ func TestGetChildObjectsFromPRStatusForTaskNames(t *testing.T) { if d := cmp.Diff(tc.expectedTRNames, trNames); d != "" { t.Errorf("expected to see TaskRun names %v. Diff %s", tc.expectedTRNames, diff.PrintWantGot(d)) } - if d := cmp.Diff(tc.expectedRunNames, runNames); d != "" { - t.Errorf("expected to see Run names %v. Diff %s", tc.expectedRunNames, diff.PrintWantGot(d)) - } if d := cmp.Diff(tc.expectedCustomRunNames, customRunNames); d != "" { t.Errorf("expected to see CustomRun names %v. Diff %s", tc.expectedCustomRunNames, diff.PrintWantGot(d)) } diff --git a/pkg/reconciler/pipelinerun/controller.go b/pkg/reconciler/pipelinerun/controller.go index 17d6866c74c..f35a8bff63b 100644 --- a/pkg/reconciler/pipelinerun/controller.go +++ b/pkg/reconciler/pipelinerun/controller.go @@ -23,7 +23,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" pipelineclient "github.com/tektoncd/pipeline/pkg/client/injection/client" - runinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/run" verificationpolicyinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy" customruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun" pipelineruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun" @@ -54,7 +53,6 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock, tracerProvi customRunInformer := customruninformer.Get(ctx) pipelineRunInformer := pipelineruninformer.Get(ctx) resolutionInformer := resolutioninformer.Get(ctx) - runInformer := runinformer.Get(ctx) verificationpolicyInformer := verificationpolicyinformer.Get(ctx) configStore := config.NewStore(logger.Named("config-store"), pipelinerunmetrics.MetricsOnStore(logger)) configStore.WatchConfigs(cmw) @@ -67,7 +65,6 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock, tracerProvi pipelineRunLister: pipelineRunInformer.Lister(), taskRunLister: taskRunInformer.Lister(), customRunLister: customRunInformer.Lister(), - runLister: runInformer.Lister(), verificationPolicyLister: verificationpolicyInformer.Lister(), cloudEventClient: cloudeventclient.Get(ctx), metrics: pipelinerunmetrics.Get(ctx), @@ -96,10 +93,6 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock, tracerProvi FilterFunc: controller.FilterController(&v1beta1.PipelineRun{}), Handler: controller.HandleAll(impl.EnqueueControllerOf), }) - runInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ - FilterFunc: controller.FilterController(&v1beta1.PipelineRun{}), - Handler: controller.HandleAll(impl.EnqueueControllerOf), - }) return impl } diff --git a/pkg/reconciler/pipelinerun/pipelinerun.go b/pkg/reconciler/pipelinerun/pipelinerun.go index 4cc2f12ea68..31f5f34df41 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun.go +++ b/pkg/reconciler/pipelinerun/pipelinerun.go @@ -28,9 +28,7 @@ import ( "github.com/hashicorp/go-multierror" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - runv1beta1 "github.com/tektoncd/pipeline/pkg/apis/run/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" pipelinerunreconciler "github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun" alpha1listers "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha1" @@ -138,7 +136,6 @@ const ( const ( taskRun = pipeline.TaskRunControllerName customRun = pipeline.CustomRunControllerName - run = pipeline.RunControllerName ) // Reconciler implements controller.Reconciler for Configuration resources. @@ -1260,7 +1257,7 @@ func validateChildObjectsInPipelineRunStatus(ctx context.Context, prs v1beta1.Pi for _, cr := range prs.ChildReferences { switch cr.Kind { - case taskRun, run, customRun: + case taskRun, customRun: continue default: err = multierror.Append(err, fmt.Errorf("child with name %s has unknown kind %s", cr.Name, cr.Kind)) @@ -1311,11 +1308,6 @@ func filterRunsForPipelineRunStatus(logger *zap.SugaredLogger, pr *v1beta1.Pipel statuses = append(statuses, &r.Status) // We can't just get the gvk from the run's TypeMeta because that isn't populated for resources created through the fake client. gvks = append(gvks, v1beta1.SchemeGroupVersion.WithKind(customRun)) - case *v1alpha1.Run: - crStatus := runv1beta1.FromRunStatus(r.Status) - statuses = append(statuses, &crStatus) - // We can't just get the gvk from the run's TypeMeta because that isn't populated for resources created through the fake client. - gvks = append(gvks, v1alpha1.SchemeGroupVersion.WithKind(run)) } } diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index a0c91bd0f1f..86805d9871b 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -33,7 +33,6 @@ import ( "github.com/google/go-containerregistry/pkg/registry" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resolutionutil "github.com/tektoncd/pipeline/pkg/internal/resolution" "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" @@ -1046,9 +1045,9 @@ func TestReconcileOnCompletedPipelineRun(t *testing.T) { // in the PipelineRun status, that the completion status is not altered, that not error is returned and // a successful event is triggered taskRunName := "test-pipeline-run-completed-hello-world-task-run" - runName := "test-pipeline-run-completed-hello-world-run" + customRunName := "test-pipeline-run-completed-hello-world-run" pipelineRunName := "test-pipeline-run-completed" - rs := []*v1alpha1.Run{parse.MustParseRun(t, fmt.Sprintf(` + crs := []*v1beta1.CustomRun{parse.MustParseCustomRun(t, fmt.Sprintf(` metadata: name: %s spec: {} @@ -1056,7 +1055,7 @@ status: conditions: - status: "False" type: Succeeded -`, runName))} +`, customRunName))} prs := []*v1beta1.PipelineRun{parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(` metadata: name: %s @@ -1079,7 +1078,7 @@ status: apiVersion: tekton.dev/v1beta1 - name: test-pipeline-run-completed-hello-world-run pipelineTaskName: hello-world-1 - kind: Run + kind: CustomRun apiVersion: tekton.dev/v1beta1 `, pipelineRunName))} ps := []*v1beta1.Pipeline{simpleHelloWorldPipeline} @@ -1100,9 +1099,9 @@ status: }, { TypeMeta: runtime.TypeMeta{ APIVersion: v1beta1.SchemeGroupVersion.String(), - Kind: run, + Kind: customRun, }, - Name: runName, + Name: customRunName, PipelineTaskName: "hello-world-1", }} @@ -1121,7 +1120,7 @@ status: Pipelines: ps, Tasks: ts, TaskRuns: trs, - Runs: rs, + CustomRuns: crs, } prt := newPipelineRunTest(t, d) defer prt.Cancel() @@ -10425,20 +10424,15 @@ spec: pr, clients := prt.reconcileRun("foo", pipelineRunName, []string{}, false) - var runsCount, taskrunsCount, customrunsCount int + var taskrunsCount, customrunsCount int for _, childRef := range pr.Status.ChildReferences { switch childRef.Kind { case taskRun: taskrunsCount++ - case run: - runsCount++ case customRun: customrunsCount++ } } - if runsCount > 0 { - t.Errorf("Expected no Run in status, but found %d", runsCount) - } if taskrunsCount > 0 { t.Errorf("Expected no TaskRuns in status, but found %d", taskrunsCount) } diff --git a/pkg/reconciler/pipelinerun/pipelinerun_updatestatus_test.go b/pkg/reconciler/pipelinerun/pipelinerun_updatestatus_test.go index 0bc023ad057..0a4196d1e2c 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_updatestatus_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_updatestatus_test.go @@ -22,7 +22,6 @@ import ( "regexp" "strings" "testing" - "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -513,20 +512,6 @@ metadata: - uid: 11111111-1111-1111-1111-111111111111 `)} - singleRunWithStatus := []v1beta1.RunObject{parse.MustParseRun(t, ` -metadata: - labels: - tekton.dev/pipelineTask: task-6 - name: pr-run-6-xxyyy - ownerReferences: - - uid: 11111111-1111-1111-1111-111111111111 -status: - conditions: - - status: Unknown - type: Succeeded - startTime: "2021-12-31T23:58:59Z" -`)} - tcs := []struct { prName string prStatus func() v1beta1.PipelineRunStatus @@ -560,32 +545,6 @@ metadata: Status: &v1beta1.CustomRunStatus{}, }, }, - }, { - prName: "status-nil-runs-with-alpha-run", - prStatus: prStatusWithEmptyEverything, - runs: singleRunWithStatus, - expectedStatusCRs: []v1beta1.ChildStatusReference{mustParseChildStatusReference(t, ` -apiVersion: tekton.dev/v1alpha1 -kind: Run -name: pr-run-6-xxyyy -pipelineTaskName: task-6 -`)}, - expectedStatusRuns: map[string]*v1beta1.PipelineRunRunStatus{ - "pr-run-6-xxyyy": { - PipelineTaskName: "task-6", - Status: &v1beta1.CustomRunStatus{ - Status: duckv1.Status{ - Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionUnknown, - }}, - }, - CustomRunStatusFields: v1beta1.CustomRunStatusFields{ - StartTime: &metav1.Time{Time: time.Date(2021, 12, 31, 23, 58, 59, 0, time.UTC)}, - }, - }, - }, - }, }, { prName: "orphaned-taskruns-pr", prStatus: func() v1beta1.PipelineRunStatus { return prStatusWithOrphans }, @@ -663,7 +622,7 @@ func TestValidateChildObjectsInPipelineRunStatus(t *testing.T) { Name: "t1", PipelineTaskName: "task-1", }, { - TypeMeta: runtime.TypeMeta{Kind: run}, + TypeMeta: runtime.TypeMeta{Kind: customRun}, Name: "r1", PipelineTaskName: "run-1", }, { @@ -687,7 +646,7 @@ func TestValidateChildObjectsInPipelineRunStatus(t *testing.T) { Name: "t1", PipelineTaskName: "task-1", }, { - TypeMeta: runtime.TypeMeta{Kind: run}, + TypeMeta: runtime.TypeMeta{Kind: customRun}, Name: "r1", PipelineTaskName: "run-1", }, diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go index 71fbb41d165..2f6ed45f837 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go @@ -23,7 +23,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" "github.com/tektoncd/pipeline/pkg/remote" @@ -159,7 +158,7 @@ func (t ResolvedPipelineTask) isFailure() bool { atLeastOneFailed := false for _, run := range t.RunObjects { isDone = isDone && run.IsDone() - runFailed := run.GetStatusCondition().GetCondition(apis.ConditionSucceeded).IsFalse() && !t.isRunRetriable() + runFailed := run.GetStatusCondition().GetCondition(apis.ConditionSucceeded).IsFalse() atLeastOneFailed = atLeastOneFailed || runFailed } return atLeastOneFailed && isDone @@ -169,7 +168,7 @@ func (t ResolvedPipelineTask) isFailure() bool { } c = t.RunObject.GetStatusCondition().GetCondition(apis.ConditionSucceeded) isDone = t.RunObject.IsDone() - return isDone && c.IsFalse() && !t.isRunRetriable() + return isDone && c.IsFalse() case t.PipelineTask.IsMatrixed(): if len(t.TaskRuns) == 0 { return false @@ -192,33 +191,6 @@ func (t ResolvedPipelineTask) isFailure() bool { } } -// isRunRetriable returns true only when the number of retries already attempted -// is less than the number of retries allowed for v1alpha1.Run. -// -// This should be removed once v1alpha1.Run is fully deprecated. -func (t ResolvedPipelineTask) isRunRetriable() bool { - switch { - case t.PipelineTask.IsMatrixed(): - if len(t.RunObjects) == 0 { - return true - } - // has remaining retries when any Run has a remaining retry - for _, run := range t.RunObjects { - if _, ok := run.(*v1alpha1.Run); ok { - if run.GetRetryCount() < t.PipelineTask.Retries { - return true - } - } - } - return false - default: - if _, ok := t.RunObject.(*v1alpha1.Run); ok { - return t.RunObject.GetRetryCount() < t.PipelineTask.Retries - } - } - return false -} - // isCancelledForTimeOut returns true only if the run is cancelled due to PipelineRun-controlled timeout // If the PipelineTask has a Matrix, isCancelled returns true if any run is cancelled due to PipelineRun-controlled timeout and all other runs are done. func (t ResolvedPipelineTask) isCancelledForTimeOut() bool { @@ -234,7 +206,7 @@ func (t ResolvedPipelineTask) isCancelledForTimeOut() bool { c := run.GetStatusCondition().GetCondition(apis.ConditionSucceeded) runCancelled := c.IsFalse() && c.Reason == v1beta1.CustomRunReasonCancelled.String() && - isRunOrCustomRunCancelledByPipelineRunTimeout(run) + isCustomRunCancelledByPipelineRunTimeout(run) atLeastOneCancelled = atLeastOneCancelled || runCancelled } return atLeastOneCancelled && isDone @@ -245,7 +217,7 @@ func (t ResolvedPipelineTask) isCancelledForTimeOut() bool { c := t.RunObject.GetStatusCondition().GetCondition(apis.ConditionSucceeded) return c != nil && c.IsFalse() && c.Reason == v1beta1.CustomRunReasonCancelled.String() && - isRunOrCustomRunCancelledByPipelineRunTimeout(t.RunObject) + isCustomRunCancelledByPipelineRunTimeout(t.RunObject) case t.PipelineTask.IsMatrixed(): if len(t.TaskRuns) == 0 { return false @@ -839,12 +811,10 @@ func (t *ResolvedPipelineTask) hasResultReferences() bool { return false } -func isRunOrCustomRunCancelledByPipelineRunTimeout(ro v1beta1.RunObject) bool { +func isCustomRunCancelledByPipelineRunTimeout(ro v1beta1.RunObject) bool { switch r := ro.(type) { case *v1beta1.CustomRun: return r.Spec.StatusMessage == v1beta1.CustomRunCancelledByPipelineTimeoutMsg - case *v1alpha1.Run: - return r.Spec.StatusMessage == v1alpha1.RunCancelledByPipelineTimeoutMsg } return false } diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go index 37e5a967262..db2276155ab 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go @@ -27,7 +27,6 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" @@ -212,7 +211,7 @@ var trs = []v1beta1.TaskRun{{ Spec: v1beta1.TaskRunSpec{}, }} -var runs = []v1beta1.CustomRun{{ +var customRuns = []v1beta1.CustomRun{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "namespace", Name: "pipelinerun-mytask13", @@ -226,20 +225,6 @@ var runs = []v1beta1.CustomRun{{ Spec: v1beta1.CustomRunSpec{}, }} -var v1alpha1Runs = []v1alpha1.Run{{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "namespace", - Name: "pipelinerun-mytask15", - }, - Spec: v1alpha1.RunSpec{}, -}, { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "namespace", - Name: "pipelinerun-mytask16", - }, - Spec: v1alpha1.RunSpec{}, -}} - var matrixedPipelineTask = &v1beta1.PipelineTask{ Name: "task", Matrix: &v1beta1.Matrix{ @@ -261,8 +246,8 @@ func makeStarted(tr v1beta1.TaskRun) *v1beta1.TaskRun { return newTr } -func makeRunStarted(run v1beta1.CustomRun) *v1beta1.CustomRun { - newRun := newRun(run) +func makeCustomRunStarted(run v1beta1.CustomRun) *v1beta1.CustomRun { + newRun := newCustomRun(run) newRun.Status.Conditions[0].Status = corev1.ConditionUnknown return newRun } @@ -273,8 +258,8 @@ func makeSucceeded(tr v1beta1.TaskRun) *v1beta1.TaskRun { return newTr } -func makeRunSucceeded(run v1beta1.CustomRun) *v1beta1.CustomRun { - newRun := newRun(run) +func makeCustomRunSucceeded(run v1beta1.CustomRun) *v1beta1.CustomRun { + newRun := newCustomRun(run) newRun.Status.Conditions[0].Status = corev1.ConditionTrue return newRun } @@ -292,14 +277,8 @@ func makeToBeRetried(tr v1beta1.TaskRun) *v1beta1.TaskRun { return newTr } -func makeV1alpha1RunFailed(run v1alpha1.Run) *v1alpha1.Run { - newRun := newV1alpha1Run(run) - newRun.Status.Conditions[0].Status = corev1.ConditionFalse - return newRun -} - -func makeRunFailed(run v1beta1.CustomRun) *v1beta1.CustomRun { - newRun := newRun(run) +func makeCustomRunFailed(run v1beta1.CustomRun) *v1beta1.CustomRun { + newRun := newCustomRun(run) newRun.Status.Conditions[0].Status = corev1.ConditionFalse return newRun } @@ -315,17 +294,12 @@ func withCancelledForTimeout(tr *v1beta1.TaskRun) *v1beta1.TaskRun { return tr } -func withV1alpha1RunCancelled(run *v1alpha1.Run) *v1alpha1.Run { - run.Status.Conditions[0].Reason = v1alpha1.RunReasonCancelled.String() - return run -} - -func withRunCancelled(run *v1beta1.CustomRun) *v1beta1.CustomRun { +func withCustomRunCancelled(run *v1beta1.CustomRun) *v1beta1.CustomRun { run.Status.Conditions[0].Reason = v1beta1.CustomRunReasonCancelled.String() return run } -func withRunCancelledForTimeout(run *v1beta1.CustomRun) *v1beta1.CustomRun { +func withCustomRunCancelledForTimeout(run *v1beta1.CustomRun) *v1beta1.CustomRun { run.Spec.StatusMessage = v1beta1.CustomRunCancelledByPipelineTimeoutMsg run.Status.Conditions[0].Reason = v1beta1.CustomRunReasonCancelled.String() return run @@ -336,7 +310,7 @@ func withCancelledBySpec(tr *v1beta1.TaskRun) *v1beta1.TaskRun { return tr } -func withRunCancelledBySpec(run *v1beta1.CustomRun) *v1beta1.CustomRun { +func withCustomRunCancelledBySpec(run *v1beta1.CustomRun) *v1beta1.CustomRun { run.Spec.Status = v1beta1.CustomRunSpecStatusCancelled return run } @@ -359,7 +333,7 @@ func withRetries(tr *v1beta1.TaskRun) *v1beta1.TaskRun { return tr } -func withRunRetries(r *v1beta1.CustomRun) *v1beta1.CustomRun { +func withCustomRunRetries(r *v1beta1.CustomRun) *v1beta1.CustomRun { r.Status.RetriesStatus = []v1beta1.CustomRunStatus{{ Status: duckv1.Status{ Conditions: []apis.Condition{{ @@ -371,18 +345,6 @@ func withRunRetries(r *v1beta1.CustomRun) *v1beta1.CustomRun { return r } -func withV1alpha1RunRetries(r *v1alpha1.Run) *v1alpha1.Run { - r.Status.RetriesStatus = []v1alpha1.RunStatus{{ - Status: duckv1.Status{ - Conditions: []apis.Condition{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - }}, - }, - }} - return r -} - func newTaskRun(tr v1beta1.TaskRun) *v1beta1.TaskRun { return &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ @@ -403,22 +365,7 @@ func withPipelineTaskRetries(pt v1beta1.PipelineTask, retries int) *v1beta1.Pipe return &pt } -func newV1alpha1Run(run v1alpha1.Run) *v1alpha1.Run { - return &v1alpha1.Run{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: run.Namespace, - Name: run.Name, - }, - Spec: run.Spec, - Status: v1alpha1.RunStatus{ - Status: duckv1.Status{ - Conditions: []apis.Condition{{Type: apis.ConditionSucceeded}}, - }, - }, - } -} - -func newRun(run v1beta1.CustomRun) *v1beta1.CustomRun { +func newCustomRun(run v1beta1.CustomRun) *v1beta1.CustomRun { return &v1beta1.CustomRun{ ObjectMeta: metav1.ObjectMeta{ Namespace: run.Namespace, @@ -529,7 +476,7 @@ var allFinishedState = PipelineRunState{{ }, }} -var noRunStartedState = PipelineRunState{{ +var noCustomRunStartedState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", @@ -541,11 +488,11 @@ var noRunStartedState = PipelineRunState{{ RunObject: nil, }} -var oneRunStartedState = PipelineRunState{{ +var oneCustomRunStartedState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", - RunObject: makeRunStarted(runs[0]), + RunObject: makeCustomRunStarted(customRuns[0]), }, { PipelineTask: &pts[13], CustomTask: true, @@ -553,11 +500,11 @@ var oneRunStartedState = PipelineRunState{{ RunObject: nil, }} -var oneRunFinishedState = PipelineRunState{{ +var oneCustomRunFinishedState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", - RunObject: makeRunSucceeded(runs[0]), + RunObject: makeCustomRunSucceeded(customRuns[0]), }, { PipelineTask: &pts[13], CustomTask: true, @@ -565,11 +512,11 @@ var oneRunFinishedState = PipelineRunState{{ RunObject: nil, }} -var oneRunFailedState = PipelineRunState{{ +var oneCustomRunFailedState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, { PipelineTask: &pts[13], CustomTask: true, @@ -586,10 +533,10 @@ var taskCancelled = PipelineRunState{{ }, }} -var runCancelled = PipelineRunState{{ +var customRunCancelled = PipelineRunState{{ PipelineTask: &pts[12], RunObjectName: "pipelinerun-mytask13", - RunObject: withRunCancelled(newRun(runs[0])), + RunObject: withCustomRunCancelled(newCustomRun(customRuns[0])), }} var noneStartedStateMatrix = PipelineRunState{{ @@ -688,7 +635,7 @@ var allFinishedStateMatrix = PipelineRunState{{ }, }} -var noRunStartedStateMatrix = PipelineRunState{{ +var noCustomRunStartedStateMatrix = PipelineRunState{{ PipelineTask: &pts[18], CustomTask: true, RunObjectNames: []string{"pipelinerun-mytask13"}, @@ -700,11 +647,11 @@ var noRunStartedStateMatrix = PipelineRunState{{ RunObjects: nil, }} -var oneRunStartedStateMatrix = PipelineRunState{{ +var oneCustomRunStartedStateMatrix = PipelineRunState{{ PipelineTask: &pts[18], CustomTask: true, RunObjectNames: []string{"pipelinerun-mytask13"}, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0])}, }, { PipelineTask: &pts[19], CustomTask: true, @@ -712,11 +659,11 @@ var oneRunStartedStateMatrix = PipelineRunState{{ RunObjects: nil, }} -var oneRunFailedStateMatrix = PipelineRunState{{ +var oneCustomRunFailedStateMatrix = PipelineRunState{{ PipelineTask: &pts[18], CustomTask: true, RunObjectNames: []string{"pipelinerun-mytask13"}, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0])}, }, { PipelineTask: &pts[19], CustomTask: true, @@ -944,14 +891,14 @@ func TestIsSkipped(t *testing.T) { "mytask12": false, }, }, { - name: "run-started", - state: oneRunStartedState, + name: "customrun-started", + state: oneCustomRunStartedState, expected: map[string]bool{ "mytask13": false, }, }, { - name: "run-cancelled", - state: runCancelled, + name: "customrun-cancelled", + state: customRunCancelled, expected: map[string]bool{ "mytask13": false, }, @@ -1299,7 +1246,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunStarted(runs[0]), + RunObject: makeCustomRunStarted(customRuns[0]), }, want: false, }, { @@ -1314,7 +1261,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunSucceeded(runs[0]), + RunObject: makeCustomRunSucceeded(customRuns[0]), }, want: false, }, { @@ -1329,7 +1276,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, want: true, }, { @@ -1337,17 +1284,9 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, CustomTask: true, - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, want: true, - }, { - name: "v1alpha1 run failed: retries remaining", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - CustomTask: true, - RunObject: makeV1alpha1RunFailed(v1alpha1Runs[0]), - }, - want: false, }, { name: "taskrun failed - Retried", rpt: ResolvedPipelineTask{ @@ -1356,19 +1295,11 @@ func TestIsFailure(t *testing.T) { }, want: true, }, { - name: "v1alpha1 run failed - Retried", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - CustomTask: true, - RunObject: withV1alpha1RunRetries(makeV1alpha1RunFailed(v1alpha1Runs[0])), - }, - want: true, - }, { - name: "run failed - Retried", + name: "customrun failed - Retried", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, CustomTask: true, - RunObject: withRunRetries(makeRunFailed(runs[0])), + RunObject: withCustomRunRetries(makeCustomRunFailed(customRuns[0])), }, want: true, }, { @@ -1393,26 +1324,26 @@ func TestIsFailure(t *testing.T) { }, want: true, }, { - name: "run cancelled", + name: "customrun cancelled", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelled(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: true, }, { - name: "run cancelled for timeout", + name: "customrun cancelled for timeout", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelledForTimeout(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelledForTimeout(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: true, }, { - name: "run cancelled but not failed", + name: "customrun cancelled but not failed", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelled(newRun(runs[0])), + RunObject: withCustomRunCancelled(newCustomRun(customRuns[0])), CustomTask: true, }, want: false, @@ -1424,18 +1355,10 @@ func TestIsFailure(t *testing.T) { }, want: true, }, { - name: "v1alpha1 run cancelled: retries remaining", - rpt: ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withV1alpha1RunCancelled(makeV1alpha1RunFailed(v1alpha1Runs[0])), - CustomTask: true, - }, - want: false, - }, { - name: "run cancelled: retries remaining", + name: "customrun cancelled: retries remaining", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withRunCancelled(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: true, @@ -1447,10 +1370,10 @@ func TestIsFailure(t *testing.T) { }, want: true, }, { - name: "run cancelled: retried", + name: "custom run cancelled: retried", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), + RunObject: withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), CustomTask: true, }, want: true, @@ -1479,7 +1402,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -1494,7 +1417,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0]), makeRunSucceeded(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0]), makeCustomRunSucceeded(customRuns[1])}, }, want: false, }, { @@ -1516,7 +1439,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunSucceeded(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunSucceeded(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -1531,7 +1454,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunFailed(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, }, want: true, }, { @@ -1546,7 +1469,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -1556,20 +1479,12 @@ func TestIsFailure(t *testing.T) { TaskRuns: []*v1beta1.TaskRun{withRetries(makeFailed(trs[0])), withRetries(makeFailed(trs[1]))}, }, want: true, - }, { - name: "matrixed v1alpha1 runs failed: retries remaining", - rpt: ResolvedPipelineTask{ - CustomTask: true, - PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeV1alpha1RunFailed(v1alpha1Runs[0]), makeV1alpha1RunFailed(v1alpha1Runs[1])}, - }, - want: false, }, { name: "matrixed runs failed: retries remaining", rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunFailed(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, }, want: true, }, { @@ -1584,7 +1499,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), withRunRetries(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), withCustomRunRetries(makeCustomRunFailed(customRuns[1]))}, }, want: true, }, { @@ -1592,7 +1507,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunRetries(makeRunFailed(runs[0])), withRunRetries(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunRetries(makeCustomRunFailed(customRuns[0])), withCustomRunRetries(makeCustomRunFailed(customRuns[1]))}, }, want: true, }, { @@ -1607,7 +1522,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), withRunCancelled(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, }, want: true, }, { @@ -1622,7 +1537,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -1637,7 +1552,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(newRun(runs[0])), withRunCancelled(newRun(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(newCustomRun(customRuns[0])), withCustomRunCancelled(newCustomRun(customRuns[1]))}, }, want: false, }, { @@ -1652,7 +1567,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(newRun(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(newCustomRun(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -1662,20 +1577,12 @@ func TestIsFailure(t *testing.T) { TaskRuns: []*v1beta1.TaskRun{withCancelled(makeFailed(trs[0])), withCancelled(makeFailed(trs[1]))}, }, want: true, - }, { - name: "matrixed v1alpha1 runs cancelled: retries remaining", - rpt: ResolvedPipelineTask{ - CustomTask: true, - PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withV1alpha1RunCancelled(makeV1alpha1RunFailed(v1alpha1Runs[0])), withV1alpha1RunCancelled(makeV1alpha1RunFailed(v1alpha1Runs[1]))}, - }, - want: false, }, { name: "matrixed runs cancelled: retries remaining", rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), withRunCancelled(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, }, want: true, }, { @@ -1690,7 +1597,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -1705,7 +1612,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), withRunCancelled(withRunRetries(makeRunFailed(runs[1])))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[1])))}, }, want: true, }, { @@ -1720,7 +1627,7 @@ func TestIsFailure(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), makeCustomRunStarted(customRuns[1])}, }, want: false, }} { @@ -3075,7 +2982,7 @@ func TestIsMatrixed(t *testing.T) { return task, nil, nil } getTaskRun := func(name string) (*v1beta1.TaskRun, error) { return &trs[0], nil } - getRun := func(name string) (v1beta1.RunObject, error) { return &runs[0], nil } + getRun := func(name string) (v1beta1.RunObject, error) { return &customRuns[0], nil } for _, tc := range []struct { name string @@ -3209,7 +3116,7 @@ func TestResolvePipelineRunTask_WithMatrix(t *testing.T) { return task, nil, nil } getTaskRun := func(name string) (*v1beta1.TaskRun, error) { return taskRunsMap[name], nil } - getRun := func(name string) (v1beta1.RunObject, error) { return &runs[0], nil } + getRun := func(name string) (v1beta1.RunObject, error) { return &customRuns[0], nil } for _, tc := range []struct { name string @@ -3405,7 +3312,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunStarted(runs[0]), + RunObject: makeCustomRunStarted(customRuns[0]), }, want: false, }, { @@ -3420,7 +3327,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunSucceeded(runs[0]), + RunObject: makeCustomRunSucceeded(customRuns[0]), }, want: true, }, { @@ -3435,7 +3342,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, want: false, }, { @@ -3450,7 +3357,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, CustomTask: true, - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, want: false, }, { @@ -3458,7 +3365,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, CustomTask: true, - RunObject: withRunRetries(makeRunFailed(runs[0])), + RunObject: withCustomRunRetries(makeCustomRunFailed(customRuns[0])), }, want: false, }, { @@ -3479,7 +3386,7 @@ func TestIsSuccessful(t *testing.T) { name: "run cancelled", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelled(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: false, @@ -3487,7 +3394,7 @@ func TestIsSuccessful(t *testing.T) { name: "run cancelled but not failed", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelled(newRun(runs[0])), + RunObject: withCustomRunCancelled(newCustomRun(customRuns[0])), CustomTask: true, }, want: false, @@ -3502,7 +3409,7 @@ func TestIsSuccessful(t *testing.T) { name: "run cancelled: retries remaining", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withRunCancelled(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: false, @@ -3517,7 +3424,7 @@ func TestIsSuccessful(t *testing.T) { name: "run cancelled: retried", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), + RunObject: withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), CustomTask: true, }, want: false, @@ -3546,7 +3453,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -3561,7 +3468,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0]), makeRunSucceeded(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0]), makeCustomRunSucceeded(customRuns[1])}, }, want: false, }, { @@ -3576,7 +3483,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunSucceeded(runs[0]), makeRunSucceeded(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunSucceeded(customRuns[0]), makeCustomRunSucceeded(customRuns[1])}, }, want: true, }, { @@ -3591,7 +3498,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunSucceeded(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunSucceeded(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -3606,7 +3513,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunFailed(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, }, want: false, }, { @@ -3621,7 +3528,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -3636,7 +3543,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunFailed(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, }, want: false, }, { @@ -3651,7 +3558,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), withRunRetries(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), withCustomRunRetries(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -3659,7 +3566,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunRetries(makeRunFailed(runs[0])), withRunRetries(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunRetries(makeCustomRunFailed(customRuns[0])), withCustomRunRetries(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -3674,7 +3581,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), withRunCancelled(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -3689,7 +3596,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -3704,7 +3611,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(newRun(runs[0])), withRunCancelled(newRun(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(newCustomRun(customRuns[0])), withCustomRunCancelled(newCustomRun(customRuns[1]))}, }, want: false, }, { @@ -3719,7 +3626,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(newRun(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(newCustomRun(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -3734,7 +3641,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), withRunCancelled(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -3749,7 +3656,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: false, }, { @@ -3764,7 +3671,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), withRunCancelled(withRunRetries(makeRunFailed(runs[1])))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[1])))}, }, want: false, }, { @@ -3779,7 +3686,7 @@ func TestIsSuccessful(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), makeCustomRunStarted(customRuns[1])}, }, want: false, }} { @@ -3821,7 +3728,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunStarted(runs[0]), + RunObject: makeCustomRunStarted(customRuns[0]), }, want: true, }, { @@ -3836,7 +3743,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunSucceeded(runs[0]), + RunObject: makeCustomRunSucceeded(customRuns[0]), }, want: false, }, { @@ -3851,7 +3758,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, CustomTask: true, - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, want: false, }, { @@ -3866,7 +3773,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, CustomTask: true, - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }, want: false, }, { @@ -3874,7 +3781,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, CustomTask: true, - RunObject: withRunRetries(makeRunFailed(runs[0])), + RunObject: withCustomRunRetries(makeCustomRunFailed(customRuns[0])), }, want: false, }, { @@ -3895,7 +3802,7 @@ func TestIsRunning(t *testing.T) { name: "run cancelled", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelled(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: false, @@ -3903,7 +3810,7 @@ func TestIsRunning(t *testing.T) { name: "run cancelled but not failed", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task"}, - RunObject: withRunCancelled(newRun(runs[0])), + RunObject: withCustomRunCancelled(newCustomRun(customRuns[0])), CustomTask: true, }, want: true, @@ -3918,7 +3825,7 @@ func TestIsRunning(t *testing.T) { name: "run cancelled: retries remaining", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withRunCancelled(makeRunFailed(runs[0])), + RunObject: withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), CustomTask: true, }, want: false, @@ -3933,7 +3840,7 @@ func TestIsRunning(t *testing.T) { name: "run cancelled: retried", rpt: ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{Name: "task", Retries: 1}, - RunObject: withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), + RunObject: withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), CustomTask: true, }, want: false, @@ -3962,7 +3869,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: true, }, { @@ -3977,7 +3884,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0]), makeRunSucceeded(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0]), makeCustomRunSucceeded(customRuns[1])}, }, want: true, }, { @@ -3992,7 +3899,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunSucceeded(runs[0]), makeRunSucceeded(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunSucceeded(customRuns[0]), makeCustomRunSucceeded(customRuns[1])}, }, want: false, }, { @@ -4007,7 +3914,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunFailed(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, }, want: false, }, { @@ -4022,7 +3929,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunStarted(customRuns[1])}, }, want: true, }, { @@ -4037,7 +3944,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), makeRunFailed(runs[1])}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), makeCustomRunFailed(customRuns[1])}, }, want: false, }, { @@ -4052,7 +3959,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{makeRunFailed(runs[0]), withRunRetries(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{makeCustomRunFailed(customRuns[0]), withCustomRunRetries(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -4060,7 +3967,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunRetries(makeRunFailed(runs[0])), withRunRetries(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunRetries(makeCustomRunFailed(customRuns[0])), withCustomRunRetries(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -4075,7 +3982,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), withRunCancelled(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -4090,7 +3997,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: true, }, { @@ -4105,7 +4012,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(newRun(runs[0])), withRunCancelled(newRun(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(newCustomRun(customRuns[0])), withCustomRunCancelled(newCustomRun(customRuns[1]))}, }, want: true, }, { @@ -4120,7 +4027,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: matrixedPipelineTask, - RunObjects: []v1beta1.RunObject{withRunCancelled(newRun(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(newCustomRun(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: true, }, { @@ -4135,7 +4042,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), withRunCancelled(makeRunFailed(runs[1]))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), withCustomRunCancelled(makeCustomRunFailed(customRuns[1]))}, }, want: false, }, { @@ -4150,7 +4057,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(makeRunFailed(runs[0])), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(makeCustomRunFailed(customRuns[0])), makeCustomRunStarted(customRuns[1])}, }, want: true, }, { @@ -4165,7 +4072,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), withRunCancelled(withRunRetries(makeRunFailed(runs[1])))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[1])))}, }, want: false, }, { @@ -4180,7 +4087,7 @@ func TestIsRunning(t *testing.T) { rpt: ResolvedPipelineTask{ CustomTask: true, PipelineTask: withPipelineTaskRetries(*matrixedPipelineTask, 1), - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(makeRunFailed(runs[0]))), makeRunStarted(runs[1])}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(makeCustomRunFailed(customRuns[0]))), makeCustomRunStarted(customRuns[1])}, }, want: true, }} { diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go b/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go index 10a2d6cfbd2..2b4fa7554e6 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunstate.go @@ -22,7 +22,6 @@ import ( "time" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" "go.uber.org/zap" @@ -182,13 +181,6 @@ func (state PipelineRunState) GetRunsResults() map[string][]v1beta1.CustomRunRes switch r := rpt.RunObject.(type) { case *v1beta1.CustomRun: results[rpt.PipelineTask.Name] = r.Status.Results - case *v1alpha1.Run: - for _, origRes := range r.Status.Results { - results[rpt.PipelineTask.Name] = append(results[rpt.PipelineTask.Name], v1beta1.CustomRunResult{ - Name: origRes.Name, - Value: origRes.Value, - }) - } } } } @@ -231,9 +223,6 @@ func (t *ResolvedPipelineTask) getChildRefForRun(runObj v1beta1.RunObject) v1bet case *v1beta1.CustomRun: apiVersion = v1beta1.SchemeGroupVersion.String() kind = pipeline.CustomRunControllerName - case *v1alpha1.Run: - apiVersion = v1alpha1.SchemeGroupVersion.String() - kind = pipeline.RunControllerName } return v1beta1.ChildStatusReference{ @@ -271,40 +260,6 @@ func (state PipelineRunState) getNextTasks(candidateTasks sets.String) []*Resolv } } } - tasks = append(tasks, state.getRetriableRuns(candidateTasks)...) - return tasks -} - -// getRetriableRuns returns a list of pipelinetasks which should be executed next when the pipelinerun is stopping, -// i.e. a list of failed pipelinetasks from candidateTasks which haven't exhausted their retries. Note that if a -// pipelinetask is cancelled, the retries are not exhausted - they are not retriable. -// -// Note: This function only detects if v1alpha1.Run is retriable. For v1beta1.CustomRun and TaskRuns, -// the retries implementation is hidden from PipelineRun reconciler. See TEP-0121 for details. -// To be removed once v1alpha1.Run is removed, see #5870 -func (state PipelineRunState) getRetriableRuns(candidateTasks sets.String) []*ResolvedPipelineTask { - var tasks []*ResolvedPipelineTask - for _, t := range state { - if _, ok := candidateTasks[t.PipelineTask.Name]; ok { - var status *apis.Condition - switch { - case t.RunObject != nil: - status = t.RunObject.GetStatusCondition().GetCondition(apis.ConditionSucceeded) - case len(t.RunObjects) != 0: - isDone := true - for _, run := range t.RunObjects { - isDone = isDone && run.IsDone() - c := run.GetStatusCondition().GetCondition(apis.ConditionSucceeded) - if c.IsFalse() { - status = c - } - } - } - if status.IsFalse() && !t.isCancelled() && t.isRunRetriable() { - tasks = append(tasks, t) - } - } - } return tasks } @@ -364,10 +319,6 @@ func (facts *PipelineRunFacts) DAGExecutionQueue() (PipelineRunState, error) { } if !facts.IsStopping() && !facts.IsGracefullyStopped() { tasks = facts.State.getNextTasks(candidateTasks) - } else { - // when pipeline run is stopping normally or gracefully, do not schedule any new tasks and only - // wait for all running tasks to complete (including exhausting retries) and report their status - tasks = facts.State.getRetriableRuns(candidateTasks) } return tasks, nil } diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go b/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go index bae8ce99631..ebde2347874 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go @@ -28,7 +28,6 @@ import ( "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" "github.com/tektoncd/pipeline/test/diff" - "github.com/tektoncd/pipeline/test/parse" "go.uber.org/zap" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -108,25 +107,25 @@ func TestPipelineRunFacts_CheckDAGTasksDoneDone(t *testing.T) { }, }} - var runRunningState = PipelineRunState{{ + var customRunRunningState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", - RunObject: makeRunStarted(runs[0]), + RunObject: makeCustomRunStarted(customRuns[0]), }} - var runSucceededState = PipelineRunState{{ + var customRunSucceededState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", - RunObject: makeRunSucceeded(runs[0]), + RunObject: makeCustomRunSucceeded(customRuns[0]), }} - var runFailedState = PipelineRunState{{ + var customRunFailedState = PipelineRunState{{ PipelineTask: &pts[12], CustomTask: true, RunObjectName: "pipelinerun-mytask13", - RunObject: makeRunFailed(runs[0]), + RunObject: makeCustomRunFailed(customRuns[0]), }} var taskCancelledFailedWithRetries = PipelineRunState{{ @@ -179,22 +178,22 @@ func TestPipelineRunFacts_CheckDAGTasksDoneDone(t *testing.T) { expected: false, ptExpected: []bool{false}, }, { - name: "run-running-no-candidates", - state: runRunningState, + name: "customrun-running-no-candidates", + state: customRunRunningState, expected: false, ptExpected: []bool{false}, }, { - name: "run-succeeded-no-candidates", - state: runSucceededState, + name: "customrun-succeeded-no-candidates", + state: customRunSucceededState, expected: true, ptExpected: []bool{true}, }, { - name: "run-failed-no-candidates", - state: runFailedState, + name: "customrun-failed-no-candidates", + state: customRunFailedState, expected: true, ptExpected: []bool{true}, }, { - name: "run-cancelled-failed-with-retries", + name: "taskrun-cancelled-failed-with-retries", state: taskCancelledFailedWithRetries, expected: true, ptExpected: []bool{true}, @@ -236,7 +235,7 @@ func TestIsBeforeFirstTaskRun_WithNotStartedTask(t *testing.T) { } func TestIsBeforeFirstTaskRun_WithNotStartedRun(t *testing.T) { - if !noRunStartedState.IsBeforeFirstTaskRun() { + if !noCustomRunStartedState.IsBeforeFirstTaskRun() { t.Fatalf("Expected state to be before first taskrun (Run test)") } } @@ -248,7 +247,7 @@ func TestIsBeforeFirstTaskRun_WithStartedTask(t *testing.T) { } func TestIsBeforeFirstTaskRun_WithStartedRun(t *testing.T) { - if oneRunStartedState.IsBeforeFirstTaskRun() { + if oneCustomRunStartedState.IsBeforeFirstTaskRun() { t.Fatalf("Expected state to be after first taskrun (Run test)") } } @@ -390,20 +389,20 @@ func TestGetNextTasks(t *testing.T) { candidates: sets.NewString("mytask5"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "no-runs-started-both-candidates", - state: noRunStartedState, + name: "no-customruns-started-both-candidates", + state: noCustomRunStartedState, candidates: sets.NewString("mytask13", "mytask14"), - expectedNext: []*ResolvedPipelineTask{noRunStartedState[0], noRunStartedState[1]}, + expectedNext: []*ResolvedPipelineTask{noCustomRunStartedState[0], noCustomRunStartedState[1]}, }, { - name: "one-run-started-both-candidates", - state: oneRunStartedState, + name: "one-customrun-started-both-candidates", + state: oneCustomRunStartedState, candidates: sets.NewString("mytask13", "mytask14"), - expectedNext: []*ResolvedPipelineTask{oneRunStartedState[1]}, + expectedNext: []*ResolvedPipelineTask{oneCustomRunStartedState[1]}, }, { - name: "one-run-failed-both-candidates", - state: oneRunFailedState, + name: "one-customrun-failed-both-candidates", + state: oneCustomRunFailedState, candidates: sets.NewString("mytask13", "mytask14"), - expectedNext: []*ResolvedPipelineTask{oneRunFailedState[1]}, + expectedNext: []*ResolvedPipelineTask{oneCustomRunFailedState[1]}, }, { name: "no-tasks-started-no-candidates-matrix", state: noneStartedStateMatrix, @@ -531,19 +530,19 @@ func TestGetNextTasks(t *testing.T) { expectedNext: []*ResolvedPipelineTask{}, }, { name: "no-runs-started-both-candidates-matrix", - state: noRunStartedStateMatrix, + state: noCustomRunStartedStateMatrix, candidates: sets.NewString("mytask19", "mytask20"), - expectedNext: []*ResolvedPipelineTask{noRunStartedStateMatrix[0], noRunStartedStateMatrix[1]}, + expectedNext: []*ResolvedPipelineTask{noCustomRunStartedStateMatrix[0], noCustomRunStartedStateMatrix[1]}, }, { name: "one-run-started-both-candidates-matrix", - state: oneRunStartedStateMatrix, + state: oneCustomRunStartedStateMatrix, candidates: sets.NewString("mytask19", "mytask20"), - expectedNext: []*ResolvedPipelineTask{oneRunStartedStateMatrix[1]}, + expectedNext: []*ResolvedPipelineTask{oneCustomRunStartedStateMatrix[1]}, }, { name: "one-run-failed-both-candidates-matrix", - state: oneRunFailedStateMatrix, + state: oneCustomRunFailedStateMatrix, candidates: sets.NewString("mytask19", "mytask20"), - expectedNext: []*ResolvedPipelineTask{oneRunFailedStateMatrix[1]}, + expectedNext: []*ResolvedPipelineTask{oneCustomRunFailedStateMatrix[1]}, }} for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { @@ -556,24 +555,6 @@ func TestGetNextTasks(t *testing.T) { } func TestGetNextTaskWithRetries(t *testing.T) { - var failedV1alpha1Run = parse.MustParseRun(t, ` -metadata: - name: custom-task - namespace: namespace -spec: - retries: 1 - params: - - name: param1 - value: value1 - ref: - apiVersion: example.dev/v0 - kind: Example -status: - conditions: - - type: Succeeded - status: "False" - reason: Timedout -`) var taskCancelledByStatusState = PipelineRunState{{ PipelineTask: &pts[4], // 2 retries needed TaskRunName: "pipelinerun-mytask1", @@ -619,60 +600,40 @@ status: }, }} - var runCancelledByStatusState = PipelineRunState{{ + var customRunCancelledByStatusState = PipelineRunState{{ PipelineTask: &pts[4], // 2 retries needed RunObjectName: "pipelinerun-mytask1", - RunObject: withRunCancelled(withRunRetries(newRun(runs[0]))), + RunObject: withCustomRunCancelled(withCustomRunRetries(newCustomRun(customRuns[0]))), CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, }, }} - var runCancelledBySpecState = PipelineRunState{{ + var customRunCancelledBySpecState = PipelineRunState{{ PipelineTask: &pts[4], RunObjectName: "pipelinerun-mytask1", - RunObject: withRunCancelledBySpec(withRunRetries(newRun(runs[0]))), + RunObject: withCustomRunCancelledBySpec(withCustomRunRetries(newCustomRun(customRuns[0]))), CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, }, }} - var runRunningState = PipelineRunState{{ + var customRunRunningState = PipelineRunState{{ PipelineTask: &pts[4], RunObjectName: "pipelinerun-mytask1", - RunObject: makeRunStarted(runs[0]), + RunObject: makeCustomRunStarted(customRuns[0]), CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, }, }} - var runSucceededState = PipelineRunState{{ + var customRunSucceededState = PipelineRunState{{ PipelineTask: &pts[4], RunObjectName: "pipelinerun-mytask1", - RunObject: makeRunSucceeded(runs[0]), - CustomTask: true, - ResolvedTask: &resources.ResolvedTask{ - TaskSpec: &task.Spec, - }, - }} - - var runRetriedState = PipelineRunState{{ - PipelineTask: &pts[3], // 1 retry needed - RunObjectName: "pipelinerun-mytask1", - RunObject: withRunCancelled(withRunRetries(newRun(runs[0]))), - CustomTask: true, - ResolvedTask: &resources.ResolvedTask{ - TaskSpec: &task.Spec, - }, - }} - - var runExpectedState = PipelineRunState{{ - PipelineTask: &pts[4], // 2 retries needed - RunObjectName: "pipelinerun-mytask1", - RunObject: failedV1alpha1Run, + RunObject: makeCustomRunSucceeded(customRuns[0]), CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, @@ -727,7 +688,7 @@ status: var runCancelledByStatusStateMatrix = PipelineRunState{{ PipelineTask: &pts[20], // 2 retries needed RunObjectNames: []string{"pipelinerun-mytask1"}, - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(newRun(runs[0])))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(newCustomRun(customRuns[0])))}, CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, @@ -737,7 +698,7 @@ status: var runCancelledBySpecStateMatrix = PipelineRunState{{ PipelineTask: &pts[20], // 2 retries needed RunObjectNames: []string{"pipelinerun-mytask1"}, - RunObjects: []v1beta1.RunObject{withRunCancelledBySpec(withRunRetries(newRun(runs[0])))}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelledBySpec(withCustomRunRetries(newCustomRun(customRuns[0])))}, CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, @@ -747,37 +708,27 @@ status: var runRunningStateMatrix = PipelineRunState{{ PipelineTask: &pts[20], // 2 retries needed RunObjectNames: []string{"pipelinerun-mytask1"}, - RunObjects: []v1beta1.RunObject{makeRunStarted(runs[0])}, + RunObjects: []v1beta1.RunObject{makeCustomRunStarted(customRuns[0])}, CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, }, }} - var runSucceededStateMatrix = PipelineRunState{{ + var customRunSucceededStateMatrix = PipelineRunState{{ PipelineTask: &pts[20], // 2 retries needed RunObjectNames: []string{"pipelinerun-mytask1"}, - RunObjects: []v1beta1.RunObject{makeRunSucceeded(runs[0])}, + RunObjects: []v1beta1.RunObject{makeCustomRunSucceeded(customRuns[0])}, CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, }, }} - var runRetriedStateMatrix = PipelineRunState{{ + var customRunRetriedStateMatrix = PipelineRunState{{ PipelineTask: &pts[17], // 1 retry needed RunObjectNames: []string{"pipelinerun-mytask1"}, - RunObjects: []v1beta1.RunObject{withRunCancelled(withRunRetries(newRun(runs[0])))}, - CustomTask: true, - ResolvedTask: &resources.ResolvedTask{ - TaskSpec: &task.Spec, - }, - }} - - var runExpectedStateMatrix = PipelineRunState{{ - PipelineTask: &pts[20], // 2 retries needed - RunObjectNames: []string{"pipelinerun-mytask1"}, - RunObjects: []v1beta1.RunObject{failedV1alpha1Run}, + RunObjects: []v1beta1.RunObject{withCustomRunCancelled(withCustomRunRetries(newCustomRun(customRuns[0])))}, CustomTask: true, ResolvedTask: &resources.ResolvedTask{ TaskSpec: &task.Spec, @@ -815,35 +766,25 @@ status: candidates: sets.NewString("mytask5"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "runs-cancelled-no-candidates", - state: runCancelledByStatusState, - candidates: sets.NewString("mytask5"), - expectedNext: []*ResolvedPipelineTask{}, - }, { - name: "runs-cancelled-bySpec-no-candidates", - state: runCancelledBySpecState, + name: "customruns-cancelled-no-candidates", + state: customRunCancelledByStatusState, candidates: sets.NewString("mytask5"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "runs-running-no-candidates", - state: runRunningState, + name: "customruns-cancelled-bySpec-no-candidates", + state: customRunCancelledBySpecState, candidates: sets.NewString("mytask5"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "run-succeeded-bySpec-no-candidates", - state: runSucceededState, + name: "customruns-running-no-candidates", + state: customRunRunningState, candidates: sets.NewString("mytask5"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "run-retried-no-candidates", - state: runRetriedState, + name: "customrun-succeeded-bySpec-no-candidates", + state: customRunSucceededState, candidates: sets.NewString("mytask5"), expectedNext: []*ResolvedPipelineTask{}, - }, { - name: "run-retried-one-candidates", - state: runExpectedState, - candidates: sets.NewString("mytask5"), - expectedNext: []*ResolvedPipelineTask{runExpectedState[0]}, }, { name: "tasks-cancelled-no-candidates-matrix", state: taskCancelledByStatusStateMatrix, @@ -880,25 +821,20 @@ status: candidates: sets.NewString("mytask21"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "runs-running-no-candidates-matrix", + name: "customruns-running-no-candidates-matrix", state: runRunningStateMatrix, candidates: sets.NewString("mytask21"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "run-succeeded-bySpec-no-candidates-matrix", - state: runSucceededStateMatrix, + name: "customrun-succeeded-bySpec-no-candidates-matrix", + state: customRunSucceededStateMatrix, candidates: sets.NewString("mytask21"), expectedNext: []*ResolvedPipelineTask{}, }, { - name: "run-retried-no-candidates-matrix", - state: runRetriedStateMatrix, + name: "customrun-retried-no-candidates-matrix", + state: customRunRetriedStateMatrix, candidates: sets.NewString("mytask21"), expectedNext: []*ResolvedPipelineTask{}, - }, { - name: "run-retried-one-candidates-matrix", - state: runExpectedStateMatrix, - candidates: sets.NewString("mytask21"), - expectedNext: []*ResolvedPipelineTask{runExpectedStateMatrix[0]}, }} // iterate over *state* to get from candidate and check if TaskRun or Run is there. @@ -952,7 +888,7 @@ func TestDAGExecutionQueue(t *testing.T) { TaskRef: &v1beta1.TaskRef{Name: "task"}, }, RunObjectName: "runningrun", - RunObject: newRun(runs[0]), + RunObject: newCustomRun(customRuns[0]), CustomTask: true, } successfulTask := ResolvedPipelineTask{ @@ -972,7 +908,7 @@ func TestDAGExecutionQueue(t *testing.T) { TaskRef: &v1beta1.TaskRef{Name: "task"}, }, RunObjectName: "successfulrun", - RunObject: makeRunSucceeded(runs[0]), + RunObject: makeCustomRunSucceeded(customRuns[0]), CustomTask: true, } failedTask := ResolvedPipelineTask{ @@ -986,41 +922,13 @@ func TestDAGExecutionQueue(t *testing.T) { TaskSpec: &task.Spec, }, } - failedRun := parse.MustParseRun(t, ` -metadata: - name: task - namespace: namespace -spec: - retries: 1 - params: - - name: param1 - value: value1 - ref: - apiVersion: example.dev/v0 - kind: Example -status: - conditions: - - type: Succeeded - status: "False" - reason: Timedout -`) failedCustomRun := ResolvedPipelineTask{ PipelineTask: &v1beta1.PipelineTask{ Name: "failedrun", TaskRef: &v1beta1.TaskRef{Name: "task"}, }, RunObjectName: "failedrun", - RunObject: makeRunFailed(runs[0]), - CustomTask: true, - } - failedRunWithRetries := ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{ - Name: "failedrunwithretries", - TaskRef: &v1beta1.TaskRef{Name: "task"}, - Retries: 1, - }, - RunObjectName: "failedrunwithretries", - RunObject: failedRun, + RunObject: makeCustomRunFailed(customRuns[0]), CustomTask: true, } tcs := []struct { @@ -1034,7 +942,6 @@ status: state: PipelineRunState{ &createdTask, &createdRun, &runningTask, &runningRun, &successfulTask, &successfulRun, - &failedRunWithRetries, }, }, { name: "gracefully cancelled", @@ -1042,7 +949,6 @@ status: state: PipelineRunState{ &createdTask, &createdRun, &runningTask, &runningRun, &successfulTask, &successfulRun, - &failedRunWithRetries, }, }, { name: "gracefully stopped", @@ -1050,35 +956,19 @@ status: state: PipelineRunState{ &createdTask, &createdRun, &runningTask, &runningRun, &successfulTask, &successfulRun, }, - }, { - name: "gracefully stopped with retryable tasks", - specStatus: v1beta1.PipelineRunSpecStatusStoppedRunFinally, - state: PipelineRunState{ - &createdTask, &createdRun, &runningTask, &runningRun, &successfulTask, &successfulRun, - &failedTask, &failedCustomRun, &failedRunWithRetries, - }, - want: PipelineRunState{&failedRunWithRetries}, }, { name: "running", state: PipelineRunState{ &createdTask, &createdRun, &runningTask, &runningRun, &successfulTask, &successfulRun, - &failedRunWithRetries, }, - want: PipelineRunState{&createdTask, &createdRun, &failedRunWithRetries}, + want: PipelineRunState{&createdTask, &createdRun}, }, { name: "stopped", state: PipelineRunState{ &createdTask, &createdRun, &runningTask, &runningRun, &successfulTask, &successfulRun, &failedTask, &failedCustomRun, }, - }, { - name: "stopped with retryable tasks", - state: PipelineRunState{ - &createdTask, &createdRun, &runningTask, &runningRun, - &successfulTask, &successfulRun, &failedCustomRun, &failedRunWithRetries, - }, - want: PipelineRunState{&failedRunWithRetries}, }, { name: "all tasks finished", state: PipelineRunState{&successfulTask, &successfulRun, &failedTask, &failedCustomRun}, @@ -1238,26 +1128,26 @@ func TestDAGExecutionQueueSequentialRuns(t *testing.T) { wantFirst: true, }, { name: "first run running", - firstRun: newRun(runs[0]), + firstRun: newCustomRun(customRuns[0]), }, { name: "first run succeeded", - firstRun: makeRunSucceeded(runs[0]), + firstRun: makeCustomRunSucceeded(customRuns[0]), wantSecond: true, }, { name: "first run failed", - firstRun: makeRunFailed(runs[0]), + firstRun: makeCustomRunFailed(customRuns[0]), }, { name: "first run succeeded, second run running", - firstRun: makeRunSucceeded(runs[0]), - secondRun: newRun(runs[1]), + firstRun: makeCustomRunSucceeded(customRuns[0]), + secondRun: newCustomRun(customRuns[1]), }, { name: "first run succeeded, second run succeeded", - firstRun: makeRunSucceeded(runs[0]), - secondRun: makeRunSucceeded(runs[1]), + firstRun: makeCustomRunSucceeded(customRuns[0]), + secondRun: makeCustomRunSucceeded(customRuns[1]), }, { name: "first run succeeded, second run failed", - firstRun: makeRunSucceeded(runs[0]), - secondRun: makeRunFailed(runs[1]), + firstRun: makeCustomRunSucceeded(customRuns[0]), + secondRun: makeCustomRunFailed(customRuns[1]), }} for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { @@ -1357,15 +1247,15 @@ func TestPipelineRunState_CompletedOrSkippedDAGTasks(t *testing.T) { expectedNames: []string{}, }, { name: "one-run-started", - state: oneRunStartedState, + state: oneCustomRunStartedState, expectedNames: []string{}, }, { name: "one-run-finished", - state: oneRunFinishedState, + state: oneCustomRunFinishedState, expectedNames: []string{pts[12].Name}, }, { name: "one-run-failed", - state: oneRunFailedState, + state: oneCustomRunFailedState, expectedNames: []string{pts[12].Name, pts[13].Name}, }} for _, tc := range tcs { @@ -2512,15 +2402,15 @@ func TestPipelineRunFacts_IsRunning(t *testing.T) { expected: false, }, { name: "no-run-started", - state: noRunStartedState, + state: noCustomRunStartedState, expected: false, }, { name: "one-run-started", - state: oneRunStartedState, + state: oneCustomRunStartedState, expected: true, }, { name: "one-run-failed", - state: oneRunFailedState, + state: oneCustomRunFailedState, expected: false, }} { t.Run(tc.name, func(t *testing.T) { @@ -3307,78 +3197,3 @@ func customRunWithName(name string) *v1beta1.CustomRun { }, } } - -func TestGetRetriableTasks(t *testing.T) { - failedRun := parse.MustParseRun(t, ` -metadata: - name: custom-task - namespace: namespace -spec: - retries: 1 - params: - - name: param1 - value: value1 - ref: - apiVersion: example.dev/v0 - kind: Example -status: - conditions: - - type: Succeeded - status: "False" - reason: Timedout -`) - failedCustomRunPT := ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{ - Name: "failedrun", - TaskRef: &v1beta1.TaskRef{Name: "task"}, - }, - RunObjectName: "failedrun", - RunObject: makeRunFailed(runs[0]), - CustomTask: true, - } - failedTaskRunPTWithRetries := ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{ - Name: "failedtask", - TaskRef: &v1beta1.TaskRef{Name: "task"}, - Retries: 1, - }, - TaskRunName: "failedtask", - TaskRun: makeFailed(trs[0]), - ResolvedTask: &resources.ResolvedTask{ - TaskSpec: &task.Spec, - }, - } - failedRunPTWithRetries := ResolvedPipelineTask{ - PipelineTask: &v1beta1.PipelineTask{ - Name: "failedrunwithretries", - TaskRef: &v1beta1.TaskRef{Name: "task"}, - Retries: 1, - }, - RunObjectName: "failedrunwithretries", - RunObject: failedRun, - CustomTask: true, - } - for _, tc := range []struct { - name string - state PipelineRunState - candidates sets.String - want []*ResolvedPipelineTask - }{{ - name: "Failed Custom Task with Retries", - state: PipelineRunState{&failedRunPTWithRetries}, - candidates: sets.String{}.Insert(failedCustomRunPT.RunObjectName).Insert(failedRunPTWithRetries.RunObjectName), - want: []*ResolvedPipelineTask{&failedRunPTWithRetries}, - }, { - name: "Failed Custom Task and TaskRuns with Retries", - state: PipelineRunState{&failedRunPTWithRetries}, - candidates: sets.String{}.Insert(failedRunPTWithRetries.RunObjectName).Insert(failedTaskRunPTWithRetries.TaskRunName), - want: []*ResolvedPipelineTask{&failedRunPTWithRetries}, - }} { - t.Run(tc.name, func(t *testing.T) { - queue := tc.state.getRetriableRuns(tc.candidates) - if d := cmp.Diff(tc.want, queue); d != "" { - t.Errorf("Didn't get expected execution queue: %s", diff.PrintWantGot(d)) - } - }) - } -} diff --git a/pkg/reconciler/pipelinerun/resources/resultrefresolution.go b/pkg/reconciler/pipelinerun/resources/resultrefresolution.go index c6c97c1e67d..4294faa1da3 100644 --- a/pkg/reconciler/pipelinerun/resources/resultrefresolution.go +++ b/pkg/reconciler/pipelinerun/resources/resultrefresolution.go @@ -20,7 +20,6 @@ import ( "fmt" "sort" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) @@ -161,12 +160,6 @@ func findRunResultForParam(runObj v1beta1.RunObject, reference *v1beta1.ResultRe return result.Value, nil } } - case *v1alpha1.Run: - for _, result := range run.Status.Results { - if result.Name == reference.Result { - return result.Value, nil - } - } } return "", fmt.Errorf("Could not find result with name %s for task %s", reference.Result, reference.PipelineTask) } diff --git a/pkg/reconciler/pipelinerun/timeout.go b/pkg/reconciler/pipelinerun/timeout.go index a9ffd83e203..025a31072f5 100644 --- a/pkg/reconciler/pipelinerun/timeout.go +++ b/pkg/reconciler/pipelinerun/timeout.go @@ -21,7 +21,6 @@ import ( "strings" "time" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" "go.uber.org/zap" @@ -33,7 +32,7 @@ import ( "knative.dev/pkg/apis" ) -var timeoutTaskRunPatchBytes, timeoutCustomRunPatchBytes, timeoutRunPatchBytes []byte +var timeoutTaskRunPatchBytes, timeoutCustomRunPatchBytes []byte func init() { var err error @@ -65,20 +64,6 @@ func init() { if err != nil { log.Fatalf("failed to marshal CustomRun timeout patch bytes: %v", err) } - timeoutRunPatchBytes, err = json.Marshal([]jsonpatch.JsonPatchOperation{ - { - Operation: "add", - Path: "/spec/status", - Value: v1alpha1.RunSpecStatusCancelled, - }, - { - Operation: "add", - Path: "/spec/statusMessage", - Value: v1alpha1.RunCancelledByPipelineTimeoutMsg, - }}) - if err != nil { - log.Fatalf("failed to marshal Run timeout patch bytes: %v", err) - } } // timeoutPipelineRun marks the PipelineRun as timed out and any resolved TaskRun(s) too. @@ -116,11 +101,6 @@ func timeoutCustomRun(ctx context.Context, customRunName string, namespace strin return err } -func timeoutRun(ctx context.Context, runName string, namespace string, clientSet clientset.Interface) error { - _, err := clientSet.TektonV1alpha1().Runs(namespace).Patch(ctx, runName, types.JSONPatchType, timeoutRunPatchBytes, metav1.PatchOptions{}, "") - return err -} - // timeoutPipelineTaskRuns patches `TaskRun` and `Run` with canceled status and an appropriate message func timeoutPipelineTasks(ctx context.Context, logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, clientSet clientset.Interface) []string { return timeoutPipelineTasksForTaskNames(ctx, logger, pr, clientSet, sets.NewString()) @@ -130,7 +110,7 @@ func timeoutPipelineTasks(ctx context.Context, logger *zap.SugaredLogger, pr *v1 func timeoutPipelineTasksForTaskNames(ctx context.Context, logger *zap.SugaredLogger, pr *v1beta1.PipelineRun, clientSet clientset.Interface, taskNames sets.String) []string { errs := []string{} - trNames, customRunNames, runNames, err := getChildObjectsFromPRStatusForTaskNames(ctx, pr.Status, taskNames) + trNames, customRunNames, err := getChildObjectsFromPRStatusForTaskNames(ctx, pr.Status, taskNames) if err != nil { errs = append(errs, err.Error()) } @@ -152,15 +132,5 @@ func timeoutPipelineTasksForTaskNames(ctx context.Context, logger *zap.SugaredLo continue } } - - for _, runName := range runNames { - logger.Infof("cancelling Run %s for timeout", runName) - - if err := timeoutRun(ctx, runName, pr.Namespace, clientSet); err != nil { - errs = append(errs, fmt.Errorf("Failed to patch Run `%s` with cancellation: %w", runName, err).Error()) - continue - } - } - return errs } diff --git a/pkg/reconciler/pipelinerun/timeout_test.go b/pkg/reconciler/pipelinerun/timeout_test.go index 39e09f408db..5292288d258 100644 --- a/pkg/reconciler/pipelinerun/timeout_test.go +++ b/pkg/reconciler/pipelinerun/timeout_test.go @@ -17,7 +17,6 @@ import ( "context" "testing" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" _ "github.com/tektoncd/pipeline/pkg/pipelinerunmetrics/fake" // Make sure the pipelinerunmetrics are setup ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" @@ -35,7 +34,6 @@ func TestTimeoutPipelineRun(t *testing.T) { pipelineRun *v1beta1.PipelineRun taskRuns []*v1beta1.TaskRun customRuns []*v1beta1.CustomRun - runs []*v1alpha1.Run wantErr bool }{{ name: "no-resolved-taskrun", @@ -124,7 +122,7 @@ func TestTimeoutPipelineRun(t *testing.T) { {ObjectMeta: metav1.ObjectMeta{Name: "t2"}}, }, }, { - name: "multiple-taskruns-and-runs", + name: "multiple-taskruns-and-customruns", pipelineRun: &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "test-pipeline-run-timedout"}, Spec: v1beta1.PipelineRunSpec{}, @@ -142,16 +140,16 @@ func TestTimeoutPipelineRun(t *testing.T) { }, { TypeMeta: runtime.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: run, + APIVersion: v1beta1.SchemeGroupVersion.String(), + Kind: customRun, }, Name: "r1", PipelineTaskName: "run-1", }, { TypeMeta: runtime.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), - Kind: run, + APIVersion: v1beta1.SchemeGroupVersion.String(), + Kind: customRun, }, Name: "r2", PipelineTaskName: "run-2", @@ -163,7 +161,7 @@ func TestTimeoutPipelineRun(t *testing.T) { {ObjectMeta: metav1.ObjectMeta{Name: "t1"}}, {ObjectMeta: metav1.ObjectMeta{Name: "t2"}}, }, - runs: []*v1alpha1.Run{ + customRuns: []*v1beta1.CustomRun{ {ObjectMeta: metav1.ObjectMeta{Name: "r1"}}, {ObjectMeta: metav1.ObjectMeta{Name: "r2"}}, }, @@ -234,7 +232,6 @@ func TestTimeoutPipelineRun(t *testing.T) { PipelineRuns: []*v1beta1.PipelineRun{tc.pipelineRun}, TaskRuns: tc.taskRuns, CustomRuns: tc.customRuns, - Runs: tc.runs, } ctx, _ := ttesting.SetupFakeContext(t) ctx, cancel := context.WithCancel(ctx) @@ -283,20 +280,6 @@ func TestTimeoutPipelineRun(t *testing.T) { } } } - if tc.runs != nil { - for _, expectedRun := range tc.runs { - r, err := c.Pipeline.TektonV1alpha1().Runs("").Get(ctx, expectedRun.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("couldn't get expected Run %s, got error %s", expectedRun.Name, err) - } - if r.Spec.Status != v1alpha1.RunSpecStatusCancelled { - t.Errorf("expected task %q to be marked as cancelled, was %q", r.Name, r.Spec.Status) - } - if r.Spec.StatusMessage != v1alpha1.RunCancelledByPipelineTimeoutMsg { - t.Errorf("expected run %s to have the timeout-specific status message, was %s", r.Name, r.Spec.StatusMessage) - } - } - } } }) } diff --git a/pkg/reconciler/run/controller.go b/pkg/reconciler/run/controller.go deleted file mode 100644 index 74368b86d16..00000000000 --- a/pkg/reconciler/run/controller.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2022 The Tekton 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. -*/ - -package run - -import ( - "context" - - "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline" - runinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/run" - runreconciler "github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1alpha1/run" - cacheclient "github.com/tektoncd/pipeline/pkg/reconciler/events/cache" - cloudeventclient "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" - "knative.dev/pkg/configmap" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" -) - -// NewController instantiates a new controller.Impl from knative.dev/pkg/controller -// This is a read-only controller, hence the SkipStatusUpdates set to true -func NewController() func(context.Context, configmap.Watcher) *controller.Impl { - return func(ctx context.Context, cmw configmap.Watcher) *controller.Impl { - logger := logging.FromContext(ctx) - runInformer := runinformer.Get(ctx) - - configStore := config.NewStore(logger.Named("config-store")) - configStore.WatchConfigs(cmw) - - c := &Reconciler{ - cloudEventClient: cloudeventclient.Get(ctx), - cacheClient: cacheclient.Get(ctx), - } - impl := runreconciler.NewImpl(ctx, c, func(impl *controller.Impl) controller.Options { - return controller.Options{ - AgentName: pipeline.RunControllerName, - ConfigStore: configStore, - SkipStatusUpdates: true, - } - }) - - runInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue)) - - return impl - } -} diff --git a/pkg/reconciler/run/run.go b/pkg/reconciler/run/run.go deleted file mode 100644 index 9a4f0f0cf16..00000000000 --- a/pkg/reconciler/run/run.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2019 The Tekton 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. -*/ - -package run - -import ( - "context" - - lru "github.com/hashicorp/golang-lru" - "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - runreconciler "github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1alpha1/run" - "github.com/tektoncd/pipeline/pkg/reconciler/events" - "github.com/tektoncd/pipeline/pkg/reconciler/events/cache" - "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" - _ "github.com/tektoncd/pipeline/pkg/taskrunmetrics/fake" // Make sure the taskrunmetrics are setup - "knative.dev/pkg/apis" - "knative.dev/pkg/logging" - pkgreconciler "knative.dev/pkg/reconciler" -) - -// Reconciler implements controller.Reconciler for Configuration resources. -type Reconciler struct { - cloudEventClient cloudevent.CEClient - cacheClient *lru.Cache -} - -// Check that our Reconciler implements runreconciler.Interface -var ( - _ runreconciler.Interface = (*Reconciler)(nil) -) - -// ReconcileKind compares the actual state with the desired, and attempts to -// converge the two. It then updates the Status block of the Task Run -// resource with the current status of the resource. -func (c *Reconciler) ReconcileKind(ctx context.Context, run *v1alpha1.Run) pkgreconciler.Event { - logger := logging.FromContext(ctx) - configs := config.FromContextOrDefaults(ctx) - ctx = cloudevent.ToContext(ctx, c.cloudEventClient) - ctx = cache.ToContext(ctx, c.cacheClient) - // ctx = cache.ToContext(ctx, c.cacheClient) - logger.Infof("Reconciling %s", run.Name) - - // Create a copy of the run object, just in case, to avoid sync'ing changes - runEvents := *run.DeepCopy() - - if configs.FeatureFlags.SendCloudEventsForRuns { - // Custom task controllers may be sending events for "Runs" associated - // to the custom tasks they control. To avoid sending duplicate events, - // CloudEvents for "Runs" are only sent when enabled - - // Read and log the condition - condition := runEvents.Status.GetCondition(apis.ConditionSucceeded) - logger.Debugf("Emitting cloudevent for %s, condition: %s", runEvents.Name, condition) - - events.EmitCloudEvents(ctx, &runEvents) - } - - return nil -} diff --git a/pkg/reconciler/run/run_test.go b/pkg/reconciler/run/run_test.go deleted file mode 100644 index 2189b33660a..00000000000 --- a/pkg/reconciler/run/run_test.go +++ /dev/null @@ -1,294 +0,0 @@ -/* -Copyright 2019 The Tekton 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. -*/ - -package run - -import ( - "context" - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent" - ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" - "github.com/tektoncd/pipeline/test" - "github.com/tektoncd/pipeline/test/names" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/record" - "knative.dev/pkg/apis" - duckv1 "knative.dev/pkg/apis/duck/v1" - cminformer "knative.dev/pkg/configmap/informer" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" - pkgreconciler "knative.dev/pkg/reconciler" - "knative.dev/pkg/system" - _ "knative.dev/pkg/system/testing" // Setup system.Namespace() -) - -func initializeRunControllerAssets(t *testing.T, d test.Data) (test.Assets, func()) { - t.Helper() - ctx, _ := ttesting.SetupFakeContext(t) - ctx = ttesting.SetupFakeCloudClientContext(ctx, d.ExpectedCloudEventCount) - ctx, cancel := context.WithCancel(ctx) - test.EnsureConfigurationConfigMapsExist(&d) - c, informers := test.SeedTestData(t, ctx, d) - configMapWatcher := cminformer.NewInformedWatcher(c.Kube, system.Namespace()) - ctl := NewController()(ctx, configMapWatcher) - if err := configMapWatcher.Start(ctx.Done()); err != nil { - t.Fatalf("error starting configmap watcher: %v", err) - } - - if la, ok := ctl.Reconciler.(pkgreconciler.LeaderAware); ok { - la.Promote(pkgreconciler.UniversalBucket(), func(pkgreconciler.Bucket, types.NamespacedName) {}) - } - - return test.Assets{ - Logger: logging.FromContext(ctx), - Controller: ctl, - Clients: c, - Informers: informers, - Recorder: controller.GetEventRecorder(ctx).(*record.FakeRecorder), - Ctx: ctx, - }, cancel -} - -func getRunName(run v1alpha1.Run) string { - return strings.Join([]string{run.Namespace, run.Name}, "/") -} - -// getRunController returns an instance of the TaskRun controller/reconciler that has been seeded with -// d, where d represents the state of the system (existing resources) needed for the test. -func getRunController(t *testing.T, d test.Data) (test.Assets, func()) { - t.Helper() - names.TestingSeed() - return initializeRunControllerAssets(t, d) -} - -// TestReconcile_CloudEvents runs reconcile with a cloud event sink configured -// to ensure that events are sent in different cases -func TestReconcile_CloudEvents(t *testing.T) { - ignoreResourceVersion := cmpopts.IgnoreFields(v1alpha1.Run{}, "ObjectMeta.ResourceVersion") - - cms := []*corev1.ConfigMap{ - { - ObjectMeta: metav1.ObjectMeta{Name: config.GetDefaultsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "default-cloud-events-sink": "http://synk:8080", - }, - }, { - ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "send-cloudevents-for-runs": "true", - }, - }, - } - testcases := []struct { - name string - condition *apis.Condition - wantCloudEvents []string - }{{ - name: "Run with no condition", - condition: nil, - wantCloudEvents: []string{`(?s)dev.tekton.event.run.started.v1.*test-run`}, - }, { - name: "Run with unknown condition", - condition: &apis.Condition{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionUnknown, - Reason: v1alpha1.RunReasonRunning.String(), - }, - wantCloudEvents: []string{`(?s)dev.tekton.event.run.running.v1.*test-run`}, - }, { - name: "Run with finished true condition", - condition: &apis.Condition{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionTrue, - Reason: v1alpha1.RunReasonSuccessful.String(), - }, - wantCloudEvents: []string{`(?s)dev.tekton.event.run.successful.v1.*test-run`}, - }, { - name: "Run with finished false condition", - condition: &apis.Condition{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - Reason: v1alpha1.RunReasonCancelled.String(), - }, - wantCloudEvents: []string{`(?s)dev.tekton.event.run.failed.v1.*test-run`}, - }} - - for _, tc := range testcases { - t.Run(tc.name, func(t *testing.T) { - objectStatus := duckv1.Status{ - Conditions: []apis.Condition{}, - } - runStatusFields := v1alpha1.RunStatusFields{} - if tc.condition != nil { - objectStatus.Conditions = append(objectStatus.Conditions, *tc.condition) - } - run := v1alpha1.Run{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-run", - Namespace: "foo", - }, - Spec: v1alpha1.RunSpec{}, - Status: v1alpha1.RunStatus{ - Status: objectStatus, - RunStatusFields: runStatusFields, - }, - } - runs := []*v1alpha1.Run{&run} - - d := test.Data{ - Runs: runs, - ConfigMaps: cms, - ExpectedCloudEventCount: len(tc.wantCloudEvents), - } - testAssets, cancel := getRunController(t, d) - defer cancel() - c := testAssets.Controller - clients := testAssets.Clients - - if err := c.Reconciler.Reconcile(testAssets.Ctx, getRunName(run)); err != nil { - t.Fatal("Didn't expect an error, but got one.") - } - - for _, a := range clients.Kube.Actions() { - aVerb := a.GetVerb() - if aVerb != "get" && aVerb != "list" && aVerb != "watch" { - t.Errorf("Expected only read actions to be logged in the kubeclient, got %s", aVerb) - } - } - - urun, err := clients.Pipeline.TektonV1alpha1().Runs(run.Namespace).Get(testAssets.Ctx, run.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("getting updated run: %v", err) - } - - if d := cmp.Diff(&run, urun, ignoreResourceVersion); d != "" { - t.Fatalf("run should not have changed, go %v instead", d) - } - - ceClient := clients.CloudEvents.(cloudevent.FakeClient) - ceClient.CheckCloudEventsUnordered(t, tc.name, tc.wantCloudEvents) - - // Try and reconcile again - expect no event - if err := c.Reconciler.Reconcile(testAssets.Ctx, getRunName(run)); err != nil { - t.Fatal("Didn't expect an error, but got one.") - } - ceClient.CheckCloudEventsUnordered(t, tc.name, []string{}) - }) - } -} - -func TestReconcile_CloudEvents_Disabled(t *testing.T) { - cmSinkOn := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{Name: config.GetDefaultsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "default-cloud-events-sink": "http://synk:8080", - }, - } - cmSinkOff := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{Name: config.GetDefaultsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "default-cloud-events-sink": "", - }, - } - cmRunsOn := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "send-cloudevents-for-runs": "true", - }, - } - cmRunsOff := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{Name: config.GetFeatureFlagsConfigName(), Namespace: system.Namespace()}, - Data: map[string]string{ - "send-cloudevents-for-runs": "false", - }, - } - testcases := []struct { - name string - cms []*corev1.ConfigMap - }{{ - name: "Both disabled", - cms: []*corev1.ConfigMap{cmSinkOff, cmRunsOff}, - }, { - name: "Sink Disabled", - cms: []*corev1.ConfigMap{cmSinkOff, cmRunsOn}, - }, { - name: "Runs Disabled", - cms: []*corev1.ConfigMap{cmSinkOn, cmRunsOff}, - }} - - for _, tc := range testcases { - t.Run(tc.name, func(t *testing.T) { - objectStatus := duckv1.Status{ - Conditions: []apis.Condition{ - { - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - Reason: v1alpha1.RunReasonCancelled.String(), - }, - }, - } - runStatusFields := v1alpha1.RunStatusFields{} - run := v1alpha1.Run{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-run", - Namespace: "foo", - }, - Spec: v1alpha1.RunSpec{}, - Status: v1alpha1.RunStatus{ - Status: objectStatus, - RunStatusFields: runStatusFields, - }, - } - runs := []*v1alpha1.Run{&run} - - d := test.Data{ - Runs: runs, - ConfigMaps: tc.cms, - } - testAssets, cancel := getRunController(t, d) - defer cancel() - c := testAssets.Controller - clients := testAssets.Clients - - if err := c.Reconciler.Reconcile(testAssets.Ctx, getRunName(run)); err != nil { - t.Fatal("Didn't expect an error, but got one.") - } - if len(clients.Kube.Actions()) == 0 { - t.Errorf("Expected actions to be logged in the kubeclient, got none") - } - - urun, err := clients.Pipeline.TektonV1alpha1().Runs(run.Namespace).Get(testAssets.Ctx, run.Name, metav1.GetOptions{}) - if err != nil { - t.Fatalf("getting updated run: %v", err) - } - - if d := cmp.Diff(run.Status, urun.Status); d != "" { - t.Fatalf("run should not have changed, go %v instead", d) - } - - ceClient := clients.CloudEvents.(cloudevent.FakeClient) - ceClient.CheckCloudEventsUnordered(t, tc.name, []string{}) - }) - } -} diff --git a/pkg/status/status.go b/pkg/status/status.go index b7508ba01a0..545b8d2361d 100644 --- a/pkg/status/status.go +++ b/pkg/status/status.go @@ -21,7 +21,6 @@ import ( "fmt" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - runv1beta1 "github.com/tektoncd/pipeline/pkg/apis/run/v1beta1" "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -45,9 +44,9 @@ func GetTaskRunStatusForPipelineTask(ctx context.Context, client versioned.Inter return &tr.Status, nil } -// GetRunStatusForPipelineTask takes a child reference and returns the actual CustomRunStatus for the +// GetCustomRunStatusForPipelineTask takes a child reference and returns the actual CustomRunStatus for the // PipelineTask. It returns an error if the child reference's kind isn't CustomRun. -func GetRunStatusForPipelineTask(ctx context.Context, client versioned.Interface, ns string, childRef v1beta1.ChildStatusReference) (*v1beta1.CustomRunStatus, error) { +func GetCustomRunStatusForPipelineTask(ctx context.Context, client versioned.Interface, ns string, childRef v1beta1.ChildStatusReference) (*v1beta1.CustomRunStatus, error) { var runStatus *v1beta1.CustomRunStatus switch childRef.Kind { @@ -60,18 +59,8 @@ func GetRunStatusForPipelineTask(ctx context.Context, client versioned.Interface return nil, nil } runStatus = &r.Status - case "Run": - r, err := client.TektonV1alpha1().Runs(ns).Get(ctx, childRef.Name, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - return nil, err - } - if r == nil { - return nil, nil - } - asCustomRunStatus := runv1beta1.FromRunStatus(r.Status) - runStatus = &asCustomRunStatus default: - return nil, fmt.Errorf("could not fetch status for PipelineTask %s: should have kind Run or CustomRun, but is %s", childRef.PipelineTaskName, childRef.Kind) + return nil, fmt.Errorf("could not fetch status for PipelineTask %s: should have kind CustomRun, but is %s", childRef.PipelineTaskName, childRef.Kind) } return runStatus, nil @@ -124,21 +113,6 @@ func GetPipelineTaskStatuses(ctx context.Context, client versioned.Interface, ns if r != nil { runStatuses[cr.Name].Status = &r.Status } - case "Run": - r, err := client.TektonV1alpha1().Runs(ns).Get(ctx, cr.Name, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - return nil, nil, err - } - - runStatuses[cr.Name] = &v1beta1.PipelineRunRunStatus{ - PipelineTaskName: cr.PipelineTaskName, - WhenExpressions: cr.WhenExpressions, - } - - if r != nil { - asCustomRunStatus := runv1beta1.FromRunStatus(r.Status) - runStatuses[cr.Name].Status = &asCustomRunStatus - } default: // Don't do anything for unknown types. } diff --git a/pkg/status/status_test.go b/pkg/status/status_test.go index e3dae9c4b79..3a93c366c10 100644 --- a/pkg/status/status_test.go +++ b/pkg/status/status_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" "github.com/tektoncd/pipeline/test" @@ -125,7 +124,7 @@ status: func TestGetRunStatusForPipelineTask(t *testing.T) { testCases := []struct { name string - run v1beta1.RunObject + run *v1beta1.CustomRun childRef v1beta1.ChildStatusReference expectedStatus *v1beta1.CustomRunStatus expectedErr error @@ -138,7 +137,7 @@ func TestGetRunStatusForPipelineTask(t *testing.T) { }, PipelineTaskName: "some-task", }, - expectedErr: errors.New("could not fetch status for PipelineTask some-task: should have kind Run or CustomRun, but is something-else"), + expectedErr: errors.New("could not fetch status for PipelineTask some-task: should have kind CustomRun, but is something-else"), }, { name: "run not found", childRef: v1beta1.ChildStatusReference{ @@ -172,30 +171,6 @@ status: }}, }, }, - }, { - name: "success with alpha run", - run: parse.MustParseRun(t, ` -metadata: - name: some-run -spec: {} -status: - conditions: - - status: "False" - type: Succeeded -`), - childRef: v1beta1.ChildStatusReference{ - TypeMeta: runtime.TypeMeta{Kind: "Run"}, - Name: "some-run", - PipelineTaskName: "some-task", - }, - expectedStatus: &v1beta1.CustomRunStatus{ - Status: duckv1.Status{ - Conditions: duckv1.Conditions{{ - Type: apis.ConditionSucceeded, - Status: corev1.ConditionFalse, - }}, - }, - }, }, } @@ -204,16 +179,11 @@ status: ctx, _ := ttesting.SetupFakeContext(t) d := test.Data{} if tc.run != nil { - switch ro := tc.run.(type) { - case *v1beta1.CustomRun: - d.CustomRuns = []*v1beta1.CustomRun{ro} - case *v1alpha1.Run: - d.Runs = []*v1alpha1.Run{ro} - } + d.CustomRuns = []*v1beta1.CustomRun{tc.run} } clients, _ := test.SeedTestData(t, ctx, d) - runStatus, err := GetRunStatusForPipelineTask(ctx, clients.Pipeline, "", tc.childRef) + runStatus, err := GetCustomRunStatusForPipelineTask(ctx, clients.Pipeline, "", tc.childRef) if tc.expectedErr != nil { if err == nil { @@ -252,21 +222,6 @@ status: metadata: name: pr-run-1 spec: {} -status: - conditions: - - status: "True" - type: Succeeded - results: - - name: foo - value: oof - - name: bar - value: rab -`) - - run2 := parse.MustParseRun(t, ` -metadata: - name: pr-run-2 -spec: {} status: conditions: - status: "True" @@ -282,7 +237,7 @@ status: name string originalPR *v1beta1.PipelineRun taskRuns []*v1beta1.TaskRun - runs []v1beta1.RunObject + runs []*v1beta1.CustomRun expectedTRStatuses map[string]*v1beta1.PipelineRunTaskRunStatus expectedRunStatuses map[string]*v1beta1.PipelineRunRunStatus expectedErr error @@ -295,7 +250,7 @@ status: expectedErr: nil, }, { - name: "taskruns runs and customruns", + name: "taskruns and customruns", originalPR: parse.MustParseV1beta1PipelineRun(t, ` metadata: name: pr @@ -310,10 +265,6 @@ status: kind: CustomRun name: pr-run-1 pipelineTaskName: run-1 - - apiVersion: tekton.dev/v1alpha1 - kind: Run - name: pr-run-2 - pipelineTaskName: run-2 conditions: - message: Not all Tasks in the Pipeline have finished executing reason: Running @@ -321,7 +272,7 @@ status: type: Succeeded `), taskRuns: []*v1beta1.TaskRun{tr1}, - runs: []v1beta1.RunObject{customRun1, run2}, + runs: []*v1beta1.CustomRun{customRun1}, expectedTRStatuses: mustParseTaskRunStatusMap(t, ` pr-task-1: pipelineTaskName: task-1 @@ -345,17 +296,6 @@ pr-run-1: value: oof - name: bar value: rab -pr-run-2: - pipelineTaskName: run-2 - status: - conditions: - - status: "True" - type: Succeeded - results: - - name: foo - value: oof - - name: bar - value: rab `), expectedErr: nil, }, { @@ -409,20 +349,8 @@ pr-run-1: if tc.originalPR != nil { d.PipelineRuns = []*v1beta1.PipelineRun{tc.originalPR} } - if len(tc.taskRuns) > 0 { - d.TaskRuns = tc.taskRuns - } - if len(tc.runs) > 0 { - for _, r := range tc.runs { - switch ro := r.(type) { - case *v1beta1.CustomRun: - d.CustomRuns = append(d.CustomRuns, ro) - case *v1alpha1.Run: - d.Runs = append(d.Runs, ro) - } - } - } - + d.TaskRuns = append(d.TaskRuns, tc.taskRuns...) + d.CustomRuns = append(d.CustomRuns, tc.runs...) clients, _ := test.SeedTestData(t, ctx, d) trStatuses, runStatuses, err := GetPipelineTaskStatuses(ctx, clients.Pipeline, "", tc.originalPR) diff --git a/test/clients.go b/test/clients.go index e003b537dbe..f92915aed17 100644 --- a/test/clients.go +++ b/test/clients.go @@ -104,7 +104,6 @@ func newClients(t *testing.T, configPath, clusterName, namespace string) *client c.V1beta1TaskRunClient = cs.TektonV1beta1().TaskRuns(namespace) c.V1beta1PipelineRunClient = cs.TektonV1beta1().PipelineRuns(namespace) c.V1beta1CustomRunClient = cs.TektonV1beta1().CustomRuns(namespace) - c.V1alpha1RunClient = cs.TektonV1alpha1().Runs(namespace) c.V1alpha1ResolutionRequestclient = rrcs.ResolutionV1alpha1().ResolutionRequests(namespace) c.V1alpha1VerificationPolicyClient = cs.TektonV1alpha1().VerificationPolicies(namespace) c.V1PipelineClient = cs.TektonV1().Pipelines(namespace) diff --git a/test/controller.go b/test/controller.go index f21d81730c8..868c8165904 100644 --- a/test/controller.go +++ b/test/controller.go @@ -31,7 +31,6 @@ import ( informersv1alpha1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha1" informersv1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" fakepipelineclient "github.com/tektoncd/pipeline/pkg/client/injection/client/fake" - fakeruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/run/fake" fakeverificationpolicyinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/verificationpolicy/fake" fakeclustertaskinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask/fake" fakecustomruninformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/customrun/fake" @@ -72,7 +71,6 @@ type Data struct { TaskRuns []*v1beta1.TaskRun Tasks []*v1beta1.Task ClusterTasks []*v1beta1.ClusterTask - Runs []*v1alpha1.Run CustomRuns []*v1beta1.CustomRun Pods []*corev1.Pod Namespaces []*corev1.Namespace @@ -182,7 +180,6 @@ func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers PipelineRun: fakepipelineruninformer.Get(ctx), Pipeline: fakepipelineinformer.Get(ctx), TaskRun: faketaskruninformer.Get(ctx), - Run: fakeruninformer.Get(ctx), CustomRun: fakecustomruninformer.Get(ctx), Task: faketaskinformer.Get(ctx), ClusterTask: fakeclustertaskinformer.Get(ctx), @@ -232,13 +229,6 @@ func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers t.Fatal(err) } } - c.Pipeline.PrependReactor("*", "runs", AddToInformer(t, i.Run.Informer().GetIndexer())) - for _, run := range d.Runs { - run := run.DeepCopy() // Avoid assumptions that the informer's copy is modified. - if _, err := c.Pipeline.TektonV1alpha1().Runs(run.Namespace).Create(ctx, run, metav1.CreateOptions{}); err != nil { - t.Fatal(err) - } - } c.Pipeline.PrependReactor("*", "customruns", AddToInformer(t, i.CustomRun.Informer().GetIndexer())) for _, customRun := range d.CustomRuns { customRun := customRun.DeepCopy() // Avoid assumptions that the informer's copy is modified. diff --git a/test/custom-task-ctrls/wait-task-alpha/README.md b/test/custom-task-ctrls/wait-task-alpha/README.md deleted file mode 100644 index dcb21b2a99c..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Wait Custom Task for Tekton supporting v1alpha1.Run - -This folder is largely copied from [experimental/wait-task](https://github.com/tektoncd/experimental/tree/main/wait-task) -for the testing purpose, with resources used for building and releasing the -wait custom task removed. - -It provides a [Tekton Custom -Task](https://tekton.dev/docs/pipelines/runs/) supporting `v1alpha1.Run`s that, when run, simply waits a -given amount of time before succeeding, specified by an input parameter named -`duration`. It also supports `timeout` and `retries`. diff --git a/test/custom-task-ctrls/wait-task-alpha/cmd/controller/main.go b/test/custom-task-ctrls/wait-task-alpha/cmd/controller/main.go deleted file mode 100644 index 1e1ffd3dc88..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/cmd/controller/main.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2021 The Tekton 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. -*/ - -package main // import "github.com/tektoncd/pipeline/test/custom-task-ctrls/wait-task-alpha/cmd/controller" - -import ( - "context" - - runinformer "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha1/run" - runreconciler "github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1alpha1/run" - tkncontroller "github.com/tektoncd/pipeline/pkg/controller" - "github.com/tektoncd/pipeline/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler" - "k8s.io/client-go/tools/cache" - "k8s.io/utils/clock" - "knative.dev/pkg/configmap" - "knative.dev/pkg/controller" - "knative.dev/pkg/injection/sharedmain" -) - -const controllerName = "wait-task-alpha-controller" - -func main() { - sharedmain.Main(controllerName, newController) -} - -func newController(ctx context.Context, cmw configmap.Watcher) *controller.Impl { - c := &reconciler.Reconciler{ - Clock: clock.RealClock{}, - } - impl := runreconciler.NewImpl(ctx, c, func(impl *controller.Impl) controller.Options { - return controller.Options{ - AgentName: controllerName, - } - }) - - runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{ - FilterFunc: tkncontroller.FilterRunRef("wait.testing.tekton.dev/v1alpha1", "Wait"), - Handler: controller.HandleAll(impl.Enqueue), - }) - - return impl -} diff --git a/test/custom-task-ctrls/wait-task-alpha/config/controller.yaml b/test/custom-task-ctrls/wait-task-alpha/config/controller.yaml deleted file mode 100644 index dd56a582daf..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/config/controller.yaml +++ /dev/null @@ -1,239 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: wait-task-alpha - labels: - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha - ---- - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: wait-task-alpha-controller - namespace: wait-task-alpha - labels: - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha - ---- - -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: wait-task-alpha-controller-cluster-access - labels: - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha -rules: - # Controller needs cluster access to all Run CRs. - - apiGroups: ["tekton.dev"] - resources: ["runs"] - verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] - - apiGroups: ["tekton.dev"] - resources: ["runs/finalizers"] - verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] - - apiGroups: ["tekton.dev"] - resources: ["runs/status"] - verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] - - # Controller needs permission to configure master-election. - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] - - # Controller needs permission to emit events associated with Run CRs. - - apiGroups: [""] - resources: ["events"] - verbs: ["get", "list", "create", "update", "delete", "patch", "watch"] - ---- - -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: wait-task-alpha-controller - namespace: wait-task-alpha - labels: - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha -rules: - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["list", "watch"] - # The controller needs access to these configmaps for logging information and runtime configuration. - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["get"] - resourceNames: ["config-logging", "config-observability", "config-leader-election"] - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: wait-task-alpha-controller - namespace: wait-task-alpha - labels: - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha -subjects: - - kind: ServiceAccount - name: wait-task-alpha-controller - namespace: wait-task-alpha -roleRef: - kind: Role - name: wait-task-alpha-controller - apiGroup: rbac.authorization.k8s.io - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: wait-task-alpha-controller-cluster-access - labels: - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha -subjects: - - kind: ServiceAccount - name: wait-task-alpha-controller - namespace: wait-task-alpha -roleRef: - kind: ClusterRole - name: wait-task-alpha-controller-cluster-access - apiGroup: rbac.authorization.k8s.io - ---- - -apiVersion: v1 -kind: ConfigMap -metadata: - name: config-logging - namespace: wait-task-alpha - labels: - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha -data: - # Common configuration for all knative codebase - zap-logger-config: | - { - "level": "info", - "development": false, - "sampling": { - "initial": 100, - "thereafter": 100 - }, - "outputPaths": ["stdout"], - "errorOutputPaths": ["stderr"], - "encoding": "json", - "encoderConfig": { - "timeKey": "", - "levelKey": "level", - "nameKey": "logger", - "callerKey": "caller", - "messageKey": "msg", - "stacktraceKey": "stacktrace", - "lineEnding": "", - "levelEncoder": "", - "timeEncoder": "", - "durationEncoder": "", - "callerEncoder": "" - } - } - - # Log level overrides - loglevel.controller: "info" - loglevel.webhook: "info" - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: wait-task-alpha-controller - namespace: wait-task-alpha - labels: - app.kubernetes.io/name: wait-task-alpha-controller - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/version: devel - app.kubernetes.io/part-of: wait-task-alpha -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: wait-task-alpha-controller - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha - template: - metadata: - annotations: - cluster-autoscaler.kubernetes.io/safe-to-evict: "false" - labels: - app.kubernetes.io/name: wait-task-alpha-controller - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/version: devel - app.kubernetes.io/part-of: wait-task-alpha - app: wait-task-alpha-controller - spec: - serviceAccountName: wait-task-alpha-controller - containers: - - name: wait-task-alpha-controller - image: ko://github.com/tektoncd/pipeline/test/custom-task-ctrls/wait-task-alpha/cmd/controller - volumeMounts: - - name: config-logging - mountPath: /etc/config-logging - env: - - name: SYSTEM_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - # If you are changing these names, you will also need to update - # the controller's Role in 200-role.yaml to include the new - # values in the "configmaps" "get" rule. - - name: CONFIG_LOGGING_NAME - value: config-logging - - name: METRICS_DOMAIN - value: wait.testing.tekton.dev/wait-task-alpha - volumes: - - name: config-logging - configMap: - name: config-logging - ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/name: wait-task-alpha-controller - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/version: devel - app.kubernetes.io/part-of: wait-task-alpha - # tekton.dev/release value replaced with inputs.params.versionTag in pipeline/tekton/publish.yaml - pipeline.tekton.dev/release: "devel" - # labels below are related to istio and should not be used for resource lookup - app: wait-task-alpha-controller - version: "devel" - name: wait-task-alpha-controller - namespace: wait-task-alpha -spec: - ports: - - name: http-metrics - port: 9090 - protocol: TCP - targetPort: 9090 - selector: - app.kubernetes.io/name: wait-task-alpha-controller - app.kubernetes.io/component: wait-task-alpha-controller - app.kubernetes.io/instance: default - app.kubernetes.io/part-of: wait-task-alpha diff --git a/test/custom-task-ctrls/wait-task-alpha/go.mod b/test/custom-task-ctrls/wait-task-alpha/go.mod deleted file mode 100644 index 42dce6b0093..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/go.mod +++ /dev/null @@ -1,88 +0,0 @@ -module github.com/tektoncd/pipeline/test/custom-task-ctrls/wait-task-alpha - -go 1.18 - -require ( - github.com/google/go-cmp v0.5.9 - github.com/tektoncd/pipeline v0.46.0 - k8s.io/api v0.26.2 - k8s.io/apimachinery v0.26.2 - k8s.io/client-go v0.25.8 - k8s.io/utils v0.0.0-20230202215443-34013725500c - knative.dev/pkg v0.0.0-20230221145627-8efb3485adcf -) - -require ( - contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect - contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/blang/semver/v4 v4.0.0 // indirect - github.com/blendle/zapdriver v1.3.1 // indirect - github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/go-kit/log v0.2.0 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-containerregistry v0.14.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/imdario/mergo v0.3.13 // indirect - github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kelseyhightower/envconfig v1.4.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.13.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/prometheus/statsd_exporter v0.21.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - go.opencensus.io v0.24.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/automaxprocs v1.4.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - golang.org/x/time v0.3.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/api v0.110.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect - google.golang.org/grpc v1.53.0 // indirect - google.golang.org/protobuf v1.29.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.25.4 // indirect - k8s.io/klog/v2 v2.80.2-0.20221028030830-9ae4992afb54 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) diff --git a/test/custom-task-ctrls/wait-task-alpha/go.sum b/test/custom-task-ctrls/wait-task-alpha/go.sum deleted file mode 100644 index 62bb64b9c09..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/go.sum +++ /dev/null @@ -1,698 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d h1:LblfooH1lKOpp1hIhukktmSAxFkqMPFk9KR6iZ0MJNI= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= -contrib.go.opencensus.io/exporter/prometheus v0.4.0 h1:0QfIkj9z/iVZgK31D9H9ohjjIDApI2GOPScCKwxedbs= -contrib.go.opencensus.io/exporter/prometheus v0.4.0/go.mod h1:o7cosnyfuPVK0tB8q0QmaQNhGnptITnPQB+z1+qeFB0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= -github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= -github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/v2 v2.13.0 h1:2zxDS8RyY1/wVPULGGbdgniGXSzLaRJVl136fLXGsYw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.14.0 h1:z58vMqHxuwvAsVwvKEkmVBz2TlgBgH5k6koEXBtlYkw= -github.com/google/go-containerregistry v0.14.0/go.mod h1:aiJ2fp/SXvkWgmYHioXnbMdlgB8eXiiYOY55gfN91Wk= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= -github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= -github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/tektoncd/pipeline v0.46.0 h1:H9lq9eAHOpNFerBwgTXv7+Rel5fUVSmMV1AxSJuquzo= -github.com/tektoncd/pipeline v0.46.0/go.mod h1:7z10VyqNl8TRFZyA3GkjhxQ0KMoIgHZ2YOkncMWaLHk= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= -go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s= -golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU= -google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 h1:znp6mq/drrY+6khTAlJUDNFFcDGV2ENLYKpMq8SyCds= -google.golang.org/genproto v0.0.0-20230223222841-637eb2293923/go.mod h1:3Dl5ZL0q0isWJt+FVcfpQyirqemEuLAK/iFvg1UP1Hw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0= -google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.2 h1:dM3cinp3PGB6asOySalOZxEG4CZ0IAdJsrYZXE/ovGQ= -k8s.io/api v0.26.2/go.mod h1:1kjMQsFE+QHPfskEcVNgL3+Hp88B80uj0QtSOlj8itU= -k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= -k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= -k8s.io/apimachinery v0.26.2 h1:da1u3D5wfR5u2RpLhE/ZtZS2P7QvDgLZTi9wrNZl/tQ= -k8s.io/apimachinery v0.26.2/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= -k8s.io/client-go v0.25.8 h1:PruqsI6qccbowI5wjeNosyE1BiKViChRWVOvCZtYnXY= -k8s.io/client-go v0.25.8/go.mod h1:Wiu5CQCaOqWugLrdvl04HK90P0QMc4oxQ3BXoJGjD+A= -k8s.io/klog/v2 v2.80.2-0.20221028030830-9ae4992afb54 h1:hWRbsoRWt44OEBnYUd4ceLy4ofBoh+p9vauWp/I5Gdg= -k8s.io/klog/v2 v2.80.2-0.20221028030830-9ae4992afb54/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/utils v0.0.0-20230202215443-34013725500c h1:YVqDar2X7YiQa/DVAXFMDIfGF8uGrHQemlrwRU5NlVI= -k8s.io/utils v0.0.0-20230202215443-34013725500c/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/pkg v0.0.0-20230221145627-8efb3485adcf h1:TwvZFDpkyqpK2OCAwvNGV2Zjk14FzIh8X8Ci/du3jYI= -knative.dev/pkg v0.0.0-20230221145627-8efb3485adcf/go.mod h1:VO/fcEsq43seuONRQxZyftWHjpMabYzRHDtpSEQ/eoQ= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler/reconciler.go b/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler/reconciler.go deleted file mode 100644 index 4528c2c3d1e..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler/reconciler.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright 2021 The Tekton 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. -*/ - -package reconciler - -import ( - "context" - "fmt" - "time" - - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/clock" - "knative.dev/pkg/controller" - "knative.dev/pkg/logging" - kreconciler "knative.dev/pkg/reconciler" -) - -const WaitTaskCancelledByRunTimeoutMsg string = "Wait Task cancelled as it times out." - -// Reconciler implements controller.Reconciler for Configuration resources. -type Reconciler struct { - Clock clock.PassiveClock -} - -// ReconcileKind implements Interface.ReconcileKind. -func (c *Reconciler) ReconcileKind(ctx context.Context, r *v1alpha1.Run) kreconciler.Event { - logger := logging.FromContext(ctx) - logger.Infof("Reconciling %s/%s", r.Namespace, r.Name) - - // Ignore completed waits. - if r.IsDone() { - logger.Info("Run is finished, done reconciling") - return nil - } - - if r.Spec.Ref == nil || - r.Spec.Ref.APIVersion != "wait.testing.tekton.dev/v1alpha1" || r.Spec.Ref.Kind != "Wait" { - // This is not a Run we should have been notified about; do nothing. - return nil - } - if r.Spec.Ref.Name != "" { - r.Status.MarkRunFailed("UnexpectedName", "Found unexpected ref name: %s", r.Spec.Ref.Name) - return nil - } - - expr := r.Spec.GetParam("duration") - if expr == nil || expr.Value.StringVal == "" { - r.Status.MarkRunFailed("MissingDuration", "The duration param was not passed") - return nil - } - if len(r.Spec.Params) != 1 { - var found []string - for _, p := range r.Spec.Params { - if p.Name == "duration" { - continue - } - found = append(found, p.Name) - } - r.Status.MarkRunFailed("UnexpectedParams", "Found unexpected params: %v", found) - return nil - } - - // Skip if the Run is cancelled. - if r.IsCancelled() { - logger.Infof("The Custom Task Run %v has been cancelled", r.GetName()) - r.Status.CompletionTime = &metav1.Time{Time: c.Clock.Now()} - var msg string = fmt.Sprint(r.Spec.StatusMessage) - if msg == "" { - msg = "The Wait Task is cancelled" - } - r.Status.MarkRunFailed("Cancelled", msg) - return nil - } - - if !r.HasStarted() { - logger.Info("Run hasn't started, start it") - r.Status.InitializeConditions() - r.Status.StartTime = &metav1.Time{Time: c.Clock.Now()} - r.Status.MarkRunRunning("Running", "Waiting for duration to elapse") - } - - duration, err := time.ParseDuration(expr.Value.StringVal) - if err != nil { - r.Status.MarkRunFailed("InvalidDuration", "The duration param was invalid: %v", err) - return nil - } - timeout := r.GetTimeout() - if duration == timeout { - r.Status.MarkRunFailed("InvalidTimeOut", "Spec.Timeout shouldn't equal duration") - return nil - } - elapsed := c.Clock.Since(r.Status.StartTime.Time) - - // Custom Task is running and not timed out - if r.Status.StartTime != nil && elapsed <= duration && elapsed <= timeout { - logger.Infof("The Custom Task Run %s is running", r.GetName()) - waitTime := duration.Nanoseconds() - if timeout.Nanoseconds() < waitTime { - waitTime = timeout.Nanoseconds() - } - return controller.NewRequeueAfter(time.Duration(waitTime)) - } - - if r.Status.StartTime != nil && elapsed > duration && elapsed <= timeout { - logger.Infof("The Custom Task Run %v finished", r.GetName()) - r.Status.CompletionTime = &metav1.Time{Time: c.Clock.Now()} - r.Status.MarkRunSucceeded("DurationElapsed", "The wait duration has elapsed") - return nil - } - - // Custom Task timed out - if r.Status.StartTime != nil && elapsed > timeout { - logger.Infof("The Custom Task Run %v timed out", r.GetName()) - r.Status.CompletionTime = &metav1.Time{Time: c.Clock.Now()} - r.Status.MarkRunFailed("TimedOut", WaitTaskCancelledByRunTimeoutMsg) - - // Retry if the current RetriesStatus hasn't reached the retries limit - if r.Spec.Retries > len(r.Status.RetriesStatus) { - logger.Infof("Run timed out, retrying... %#v", r.Status) - retryRun(r) - return controller.NewRequeueImmediately() - } - - return nil - } - - // Don't emit events on nop-reconciliations, it causes scale problems. - return nil -} - -func retryRun(run *v1alpha1.Run) { - // Add retry history - newStatus := *run.Status.DeepCopy() - newStatus.RetriesStatus = nil - run.Status.RetriesStatus = append(run.Status.RetriesStatus, newStatus) - - // Clear status - run.Status.StartTime = nil - run.Status.CompletionTime = nil - - run.Status.MarkRunRunning("", "") -} diff --git a/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler/reconciler_test.go b/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler/reconciler_test.go deleted file mode 100644 index bbe785e208c..00000000000 --- a/test/custom-task-ctrls/wait-task-alpha/pkg/reconciler/reconciler_test.go +++ /dev/null @@ -1,386 +0,0 @@ -/* -Copyright 2021 The Tekton 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. -*/ - -package reconciler - -import ( - "context" - "fmt" - "strings" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - "github.com/tektoncd/pipeline/test/parse" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clock "k8s.io/utils/clock/testing" - "knative.dev/pkg/apis" - "knative.dev/pkg/test/helpers" -) - -const ( - apiVersion string = "wait.testing.tekton.dev/v1alpha1" - kind string = "Wait" -) - -var ( - filterTypeMeta = cmpopts.IgnoreFields(metav1.TypeMeta{}, "Kind", "APIVersion") - filterObjectMeta = cmpopts.IgnoreFields(metav1.ObjectMeta{}, "ResourceVersion", "UID", "CreationTimestamp", "Generation", "ManagedFields") - filterCondition = cmpopts.IgnoreFields(apis.Condition{}, "LastTransitionTime.Inner.Time", "Message") - filterRunStatus = cmpopts.IgnoreFields(v1alpha1.RunStatusFields{}, "StartTime", "CompletionTime") - filterPipelineRunStatus = cmpopts.IgnoreFields(v1beta1.PipelineRunStatusFields{}, "StartTime", "CompletionTime") - - now = time.Date(2022, time.January, 1, 0, 0, 0, 0, time.UTC) - testClock = clock.NewFakePassiveClock(now) -) - -func TestReconcile(t *testing.T) { - t.Parallel() - for _, tc := range []struct { - name string - refName string - timeout string - params string - startTime *metav1.Time - wantRunConditionType apis.ConditionType - wantRunConditionStatus corev1.ConditionStatus - wantRunConditionReason string - isCancelled bool - }{{ - name: "duration elapsed", - params: ` - params: - - name: duration - value: 1s -`, - startTime: &metav1.Time{Time: time.Unix(testClock.Now().Unix()-2, 0)}, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionTrue, - wantRunConditionReason: "DurationElapsed", - }, { - name: "unexpected ref name", - refName: "meow", - params: ` - params: - - name: duration - value: 1s -`, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "UnexpectedName", - isCancelled: false, - }, { - name: "no duration param", - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "MissingDuration", - isCancelled: false, - }, { - name: "extra param", - params: ` - params: - - name: duration - value: 1s - - name: not-duration - value: blah -`, wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "UnexpectedParams", - isCancelled: false, - }, { - name: "duration param is not a string", - params: ` - params: - - name: duration - value: - - blah - - blah - - blah -`, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "MissingDuration", - isCancelled: false, - }, { - name: "invalid duration value", - params: ` - params: - - name: duration - value: blah -`, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "InvalidDuration", - isCancelled: false, - }, { - name: "timeout", - timeout: "1s", - params: ` - params: - - name: duration - value: 2s -`, - startTime: &metav1.Time{Time: time.Unix(testClock.Now().Unix()-2, 0)}, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "TimedOut", - isCancelled: false, - }, { - name: "timeout equals duration", - timeout: "1s", - params: ` - params: - - name: duration - value: 1s -`, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "InvalidTimeOut", - isCancelled: false, - }, { - name: "parent pr timeout", - timeout: "1s", - params: ` - params: - - name: duration - value: 2s -`, - wantRunConditionType: apis.ConditionSucceeded, - wantRunConditionStatus: corev1.ConditionFalse, - wantRunConditionReason: "Cancelled", - isCancelled: true, - }} { - t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() - rec := &Reconciler{ - Clock: testClock, - } - - runName := helpers.ObjectNameForTest(t) - runYAML := fmt.Sprintf(` -metadata: - name: %s -spec: - timeout: %s - ref: - apiVersion: %s - kind: %s - name: %s -`, runName, tc.timeout, apiVersion, kind, tc.refName) - if tc.params != "" { - runYAML = runYAML + tc.params - } - r := parse.MustParseRun(t, runYAML) - if tc.isCancelled { - r.Spec.Status = v1alpha1.RunSpecStatusCancelled - } - if tc.startTime != nil { - r.Status.StartTime = tc.startTime - } - - err := rec.ReconcileKind(ctx, r) - if err != nil { - t.Fatalf("Failed to reconcile: %v", err) - } - - // Compose expected Run - wantRunYAML := fmt.Sprintf(` -metadata: - name: %s -spec: - timeout: %s - ref: - apiVersion: %s - kind: %s - name: %s -`, runName, tc.timeout, apiVersion, kind, tc.refName) - if tc.params != "" { - wantRunYAML = wantRunYAML + tc.params - } - wantRunYAML = wantRunYAML + fmt.Sprintf(` -status: - conditions: - - reason: %s - status: %q - type: %s - observedGeneration: 0 -`, tc.wantRunConditionReason, tc.wantRunConditionStatus, tc.wantRunConditionType) - wantRun := parse.MustParseRun(t, wantRunYAML) - if tc.isCancelled { - wantRun.Spec.Status = v1alpha1.RunSpecStatusCancelled - } - - if d := cmp.Diff(wantRun, r, - filterTypeMeta, - filterObjectMeta, - filterCondition, - filterRunStatus, - ); d != "" { - t.Errorf("-got +want: %v", d) - } - }) - } -} - -func TestReconcile_Retries(t *testing.T) { - for _, tc := range []struct { - name string - duration string - timeout string - startTime *metav1.Time - retries int - params string - currentStatus string - wantStatus string - isCancelled bool - }{{ - name: "retry when timeout", - duration: "2s", - timeout: "1s", - startTime: &metav1.Time{Time: time.Unix(testClock.Now().Unix()-2, 0)}, - retries: 1, - currentStatus: fmt.Sprintf(` -status: - conditions: - - reason: %s - status: %q - type: %s - observedGeneration: 0 -`, "Running", corev1.ConditionUnknown, apis.ConditionSucceeded), - wantStatus: fmt.Sprintf(` -status: - conditions: - - reason: %s - status: %q - type: %s - observedGeneration: 0 - retriesStatus: - - conditions: - - reason: %s - status: %q - type: %s -`, "", corev1.ConditionUnknown, apis.ConditionSucceeded, "TimedOut", corev1.ConditionFalse, apis.ConditionSucceeded), - isCancelled: false, - }, { - name: "don't retry if retries unspecified", - duration: "2s", - timeout: "1s", - startTime: &metav1.Time{Time: time.Unix(testClock.Now().Unix()-2, 0)}, - currentStatus: fmt.Sprintf(` -status: - conditions: - - reason: %s - status: %q - type: %s - observedGeneration: 0 -`, "TimedOut", corev1.ConditionFalse, apis.ConditionSucceeded), - wantStatus: fmt.Sprintf(` -status: - conditions: - - reason: %s - status: %q - type: %s - observedGeneration: 0 -`, "TimedOut", corev1.ConditionFalse, apis.ConditionSucceeded), - isCancelled: false, - }, { - name: "don't retry when canceled", - duration: "2s", - wantStatus: fmt.Sprintf(` -status: - conditions: - - reason: %s - status: %q - type: %s - observedGeneration: 0 -`, "Cancelled", corev1.ConditionFalse, apis.ConditionSucceeded), - isCancelled: true, - }} { - t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() - rec := &Reconciler{ - Clock: testClock, - } - - runName := helpers.ObjectNameForTest(t) - runYAML := fmt.Sprintf(` -metadata: - name: %s -spec: - retries: %d - timeout: %s - ref: - apiVersion: %s - kind: %s - params: - - name: duration - value: %s -`, runName, tc.retries, tc.timeout, apiVersion, kind, tc.duration) - if tc.currentStatus != "" { - runYAML = runYAML + tc.currentStatus - } - r := parse.MustParseRun(t, runYAML) - if tc.isCancelled { - r.Spec.Status = v1alpha1.RunSpecStatusCancelled - } - if tc.startTime != nil { - r.Status.StartTime = tc.startTime - } - - err := rec.ReconcileKind(ctx, r) - if err != nil { - // Ignoring the requeue error because we are testing a single - // round of reconciliation given Run Spec and Status. - if !strings.Contains(err.Error(), "requeue") { - t.Fatalf("Failed to reconcile: %v", err) - } - } - - // Compose expected Run - wantRunYAML := fmt.Sprintf(` -metadata: - name: %s -spec: - retries: %d - timeout: %s - ref: - apiVersion: %s - kind: %s - params: - - name: duration - value: %s -`, runName, tc.retries, tc.timeout, apiVersion, kind, tc.duration) - wantRunYAML = wantRunYAML + tc.wantStatus - wantRun := parse.MustParseRun(t, wantRunYAML) - if tc.isCancelled { - wantRun.Spec.Status = v1alpha1.RunSpecStatusCancelled - } - - if d := cmp.Diff(wantRun, r, - filterTypeMeta, - filterObjectMeta, - filterCondition, - filterRunStatus, - ); d != "" { - t.Errorf("-got +want: %v", d) - } - }) - } -} diff --git a/test/parse/yaml.go b/test/parse/yaml.go index 13150c62e60..3ee9f8349a6 100644 --- a/test/parse/yaml.go +++ b/test/parse/yaml.go @@ -45,17 +45,6 @@ kind: TaskRun return &tr } -// MustParseRun takes YAML and parses it into a *v1alpha1.Run -func MustParseRun(t *testing.T, yaml string) *v1alpha1.Run { - t.Helper() - var r v1alpha1.Run - yaml = `apiVersion: tekton.dev/v1alpha1 -kind: Run -` + yaml - mustParseYAML(t, yaml, &r) - return &r -} - // MustParseV1beta1Task takes YAML and parses it into a *v1beta1.Task func MustParseV1beta1Task(t *testing.T, yaml string) *v1beta1.Task { t.Helper() diff --git a/test/wait.go b/test/wait.go index 0dd0f83fedb..b22e3111074 100644 --- a/test/wait.go +++ b/test/wait.go @@ -107,26 +107,6 @@ func WaitForTaskRunState(ctx context.Context, c *clients, name string, inState C }) } -// WaitForRunState polls the status of the Run called name from client every -// interval until inState returns `true` indicating it is done, returns an -// error or timeout. desc will be used to name the metric that is emitted to -// track how long it took for name to get into the state checked by inState. -func WaitForRunState(ctx context.Context, c *clients, name string, polltimeout time.Duration, inState ConditionAccessorFn, desc string) error { - metricName := fmt.Sprintf("WaitForRunState/%s/%s", name, desc) - _, span := trace.StartSpan(context.Background(), metricName) - defer span.End() - - ctx, cancel := context.WithTimeout(ctx, polltimeout) - defer cancel() - return pollImmediateWithContext(ctx, func() (bool, error) { - r, err := c.V1alpha1RunClient.Get(ctx, name, metav1.GetOptions{}) - if err != nil { - return true, err - } - return inState(&r.Status) - }) -} - // WaitForDeploymentState polls the status of the Deployment called name // from client every interval until inState returns `true` indicating it is done, // returns an error or timeout. desc will be used to name the metric that is emitted to