From 16912c0e1b54fa3257693c0479ea5486dfc2d840 Mon Sep 17 00:00:00 2001 From: Christie Wilson Date: Mon, 17 Sep 2018 16:44:41 -0700 Subject: [PATCH] Add values for `type`s in resources Added values for the following types, which would be the initial types we would want to implement and support (could expand to support more in the future): - `SourceType` - `ArtifactType` - `ResultTargetType` - `PipelineTriggerType` and `TaskTriggerType` - `ParamType` (just strings for now?) Since in #39 @pivotal-nader-ziada and @shashwathi are combining Sources and Artifacts into one concept, we'll likely combine `SourceType` and `ArtifactType` into one type as well. While doing this noticed and cleaned up a couple things: - Don't need to specify lists of result stores, just one for each type (test, log, runs). Also these are identical except for their usage, so we can use a common type for all of them - Turns out pipeline run specs were not defined! - Updated DEVELOPMENT.md re. how to regenerate generated code (such as `zz_generated.deepcopy.go`) Fixes #18 --- DEVELOPMENT.md | 10 ++ .../crds/pipeline_v1beta1_pipelineparams.yaml | 78 ++++----- config/crds/pipeline_v1beta1_pipelinerun.yaml | 32 ++++ config/crds/pipeline_v1beta1_taskrun.yaml | 78 ++++----- .../pipeline_v1beta1_pipelineparams.yaml | 6 +- .../samples/pipeline_v1beta1_pipelinerun.yaml | 5 +- config/samples/pipeline_v1beta1_taskrun.yaml | 6 +- examples/invocations/kritis-pipeline-run.yaml | 5 +- examples/invocations/run-kritis-test.yaml | 6 +- examples/pipelineparams.yaml | 6 +- .../pipeline/v1beta1/pipelineparams_types.go | 77 ++++----- .../pipeline/v1beta1/pipelinerun_types.go | 41 ++++- pkg/apis/pipeline/v1beta1/task_types.go | 27 ++- pkg/apis/pipeline/v1beta1/taskrun_types.go | 36 ++-- .../pipeline/v1beta1/zz_generated.deepcopy.go | 163 +++++++++--------- 15 files changed, 330 insertions(+), 246 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index c0f5e1d32a2..542f4c75e1c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -33,6 +33,16 @@ This repo uses [`dep`](https://golang.github.io/dep/docs/daily-dep.html) for dep * `dep ensure` should be a no-op * Add a dep with `dep ensure -add $MY_DEP` +### Changing types + +When updating types, you should regenerate any generated code with: + +```bash +make generate +``` + +Then test this by [installing and running](#installing-and-running). + ### Installing and running The skeleton for this project was generated using [kubebuilder](https://book.kubebuilder.io/quick_start.html), diff --git a/config/crds/pipeline_v1beta1_pipelineparams.yaml b/config/crds/pipeline_v1beta1_pipelineparams.yaml index 6ab82e496cc..c60d6f71f80 100644 --- a/config/crds/pipeline_v1beta1_pipelineparams.yaml +++ b/config/crds/pipeline_v1beta1_pipelineparams.yaml @@ -40,50 +40,44 @@ spec: results: properties: logs: - items: - properties: - name: - type: string - type: - type: string - url: - type: string - required: - - name - - type - - url - type: object - type: array + properties: + name: + type: string + type: + type: string + url: + type: string + required: + - name + - type + - url + type: object runs: - items: - properties: - name: - type: string - type: - type: string - url: - type: string - required: - - name - - type - - url - type: object - type: array + properties: + name: + type: string + type: + type: string + url: + type: string + required: + - name + - type + - url + type: object tests: - items: - properties: - name: - type: string - type: - type: string - url: - type: string - required: - - name - - type - - url - type: object - type: array + properties: + name: + type: string + type: + type: string + url: + type: string + required: + - name + - type + - url + type: object required: - runs - logs diff --git a/config/crds/pipeline_v1beta1_pipelinerun.yaml b/config/crds/pipeline_v1beta1_pipelinerun.yaml index 217f8c5c62b..c8beb0556ff 100644 --- a/config/crds/pipeline_v1beta1_pipelinerun.yaml +++ b/config/crds/pipeline_v1beta1_pipelinerun.yaml @@ -21,6 +21,38 @@ spec: metadata: type: object spec: + properties: + pipelineParamsRef: + properties: + apiVersion: + type: string + name: + type: string + required: + - name + type: object + pipelineRef: + properties: + apiVersion: + type: string + name: + type: string + required: + - name + type: object + triggerRef: + properties: + name: + type: string + type: + type: string + required: + - type + type: object + required: + - pipelineRef + - pipelineParamsRef + - triggerRef type: object status: properties: diff --git a/config/crds/pipeline_v1beta1_taskrun.yaml b/config/crds/pipeline_v1beta1_taskrun.yaml index 56992d53afa..4cbedfb670b 100644 --- a/config/crds/pipeline_v1beta1_taskrun.yaml +++ b/config/crds/pipeline_v1beta1_taskrun.yaml @@ -97,50 +97,44 @@ spec: results: properties: logs: - items: - properties: - name: - type: string - type: - type: string - url: - type: string - required: - - name - - type - - url - type: object - type: array + properties: + name: + type: string + type: + type: string + url: + type: string + required: + - name + - type + - url + type: object runs: - items: - properties: - name: - type: string - type: - type: string - url: - type: string - required: - - name - - type - - url - type: object - type: array + properties: + name: + type: string + type: + type: string + url: + type: string + required: + - name + - type + - url + type: object tests: - items: - properties: - name: - type: string - type: - type: string - url: - type: string - required: - - name - - type - - url - type: object - type: array + properties: + name: + type: string + type: + type: string + url: + type: string + required: + - name + - type + - url + type: object required: - runs - logs diff --git a/config/samples/pipeline_v1beta1_pipelineparams.yaml b/config/samples/pipeline_v1beta1_pipelineparams.yaml index 1badc502b40..0b3cd85913e 100644 --- a/config/samples/pipeline_v1beta1_pipelineparams.yaml +++ b/config/samples/pipeline_v1beta1_pipelineparams.yaml @@ -20,17 +20,17 @@ spec: url: 'gcr.io/wizzbang-staging' results: runs: - - name: 'runsBucket' + name: 'runsBucket' type: 'gcs' url: 'gcs://somebucket/results/runs' token: 'todo' logs: - - name: 'logBucket' + name: 'logBucket' type: 'gcs' url: 'gcs://somebucket/results/logs' token: 'todo' tests: - - name: 'testBucket' + name: 'testBucket' type: 'gcs' url: 'gcs://somebucket/results/tests' token: 'todo' diff --git a/config/samples/pipeline_v1beta1_pipelinerun.yaml b/config/samples/pipeline_v1beta1_pipelinerun.yaml index 33681c1ab39..27f05697d06 100644 --- a/config/samples/pipeline_v1beta1_pipelinerun.yaml +++ b/config/samples/pipeline_v1beta1_pipelinerun.yaml @@ -8,9 +8,8 @@ spec: name: wizzbang-pipeline pipelineParamsRef: name: wizzbang-pipeline-params - trigger: - triggerRef: - type: manual + triggerRef: + type: manual status: taskRuns: - taskRef: diff --git a/config/samples/pipeline_v1beta1_taskrun.yaml b/config/samples/pipeline_v1beta1_taskrun.yaml index f8b6b4b150d..60cdc8f483b 100644 --- a/config/samples/pipeline_v1beta1_taskrun.yaml +++ b/config/samples/pipeline_v1beta1_taskrun.yaml @@ -30,15 +30,15 @@ spec: storeKey: registry # registy is the name of the ArtifactStore results: runs: - - name: 'runsBucket' + name: 'runsBucket' type: 'gcs' url: 'gcs://somebucket/results/runs' logs: - - name: 'logBucket' + name: 'logBucket' type: 'gcs' url: 'gcs://somebucket/results/logs' tests: - - name: 'testBucket' + name: 'testBucket' type: 'gcs' url: 'gcs://somebucket/results/tests' status: diff --git a/examples/invocations/kritis-pipeline-run.yaml b/examples/invocations/kritis-pipeline-run.yaml index 23584a58b94..cb5fc36f2ba 100644 --- a/examples/invocations/kritis-pipeline-run.yaml +++ b/examples/invocations/kritis-pipeline-run.yaml @@ -8,9 +8,8 @@ spec: name: kritis-pipeline pipelineParamsRef: name: pipelineparams-sample - trigger: - triggerRef: - type: manual + triggerRef: + type: manual status: taskRuns: - taskRef: diff --git a/examples/invocations/run-kritis-test.yaml b/examples/invocations/run-kritis-test.yaml index 7bfcf7ee6c4..41a0140c92c 100644 --- a/examples/invocations/run-kritis-test.yaml +++ b/examples/invocations/run-kritis-test.yaml @@ -23,15 +23,15 @@ spec: value: 'test' results: runs: - - name: 'runsBucket' + name: 'runsBucket' type: 'gcs' url: 'gcs://somebucket/results/runs' logs: - - name: 'logBucket' + name: 'logBucket' type: 'gcs' url: 'gcs://somebucket/results/logs' tests: - - name: 'testBucket' + name: 'testBucket' type: 'gcs' url: 'gcs://somebucket/results/tests' status: diff --git a/examples/pipelineparams.yaml b/examples/pipelineparams.yaml index 7cd02b964e7..a9cc5b7ce0c 100644 --- a/examples/pipelineparams.yaml +++ b/examples/pipelineparams.yaml @@ -39,17 +39,17 @@ spec: endpoint: 'https://staging.gke.corp.com' results: runs: - - name: 'runsBucket' + name: 'runsBucket' type: 'gcs' url: 'gcs://somebucket/results/runs' token: 'todo' logs: - - name: 'logBucket' + name: 'logBucket' type: 'gcs' url: 'gcs://somebucket/results/logs' token: 'todo' tests: - - name: 'testBucket' + name: 'testBucket' type: 'gcs' url: 'gcs://somebucket/results/tests' token: 'todo' diff --git a/pkg/apis/pipeline/v1beta1/pipelineparams_types.go b/pkg/apis/pipeline/v1beta1/pipelineparams_types.go index 00b9dc278d4..0cb66b6079d 100644 --- a/pkg/apis/pipeline/v1beta1/pipelineparams_types.go +++ b/pkg/apis/pipeline/v1beta1/pipelineparams_types.go @@ -28,15 +28,28 @@ type PipelineParamsSpec struct { Results Results `json:"results"` } +// SourceType represents the type of endpoint the Source is, so that the +// controller will know this Source should be fetched and optionally what +// additional metatdata should be provided for it. +type SourceType string + +const ( + // SourceTypeGitHub indicates that this source is a GitHub repo. + SourceTypeGitHub SourceType = "github" + + // SourceTypeGCS indicates that this source is a GCS bucket. + SourceTypeGCS SourceType = "gcs" +) + // Source is an endpoint from which to get data which is required // by a Build/Task for context (e.g. a repo from which to build an image). type Source struct { - Name string `json:"name"` - Type string `json:"type"` - URL string `json:"url"` - Branch string `json:"branch"` - Commit string `json:"commit,omitempty"` - ServiceAccount string `json:"serviceAccount,omitempty"` + Name string `json:"name"` + Type SourceType `json:"type"` + URL string `json:"url"` + Branch string `json:"branch"` + Commit string `json:"commit,omitempty"` + ServiceAccount string `json:"serviceAccount,omitempty"` } // PipelineParamsStatus defines the observed state of PipelineParams @@ -69,52 +82,30 @@ type ArtifactStore struct { // Results tells a pipeline where to persist the results of runnign the pipeline. type Results struct { // Runs is used to store the yaml/json of TaskRuns and PipelineRuns. - // TODO(aaron-prindle) make this generic - // Runs []ResultTarget `json:"name"` - Runs []Run `json:"runs"` + Runs ResultTarget `json:"runs"` // Logs will store all logs output from running a task. - // TODO(aaron-prindle) make this generic - // Logs []ResultTarget `json:"type"` - Logs []Log `json:"logs"` + Logs ResultTarget `json:"logs"` // Tests will store test results, if a task provides them. - // TODO(aaron-prindle) make this generic - // Tests []ResultTarget `json:"tests,omitempty"` - Tests []Test `json:"tests,omitempty"` + Tests ResultTarget `json:"tests,omitempty"` } -// TODO(aaron-prindle) make this generic -// ResultTarget is used to identify an endpoint where results can be uploaded. The -// serviceaccount used for the pipeline must have access to this endpoint. -// type ResultTarget struct { -// Name string `json:"name"` -// Type string `json:"type"` -// URL string `json:"url"` -// } - -// Run is used to identify an endpoint where results can be uploaded. The -// serviceaccount used for the pipeline must have access to this endpoint. -type Run struct { - Name string `json:"name"` - Type string `json:"type"` - URL string `json:"url"` -} +// ResultTargetType represents the type of endpoint that this result target is, +// so that the controller will know how to write results to it. +type ResultTargetType string -// Log is used to identify an endpoint where results can be uploaded. The -// serviceaccount used for the pipeline must have access to this endpoint. -type Log struct { - Name string `json:"name"` - Type string `json:"type"` - URL string `json:"url"` -} +const ( + // ResultTargetTypeGCS indicates that the URL endpoint is a GCS bucket. + ResultTargetTypeGCS = "gcs" +) -// Test is used to identify an endpoint where results can be uploaded. The +// ResultTarget is used to identify an endpoint where results can be uploaded. The // serviceaccount used for the pipeline must have access to this endpoint. -type Test struct { - Name string `json:"name"` - Type string `json:"type"` - URL string `json:"url"` +type ResultTarget struct { + Name string `json:"name"` + Type ResultTargetType `json:"type"` + URL string `json:"url"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_types.go b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go index e35e95bdfde..fe8cbe171b4 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go @@ -21,13 +21,44 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - // PipelineRunSpec defines the desired state of PipelineRun type PipelineRunSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file + PipelineRef PipelineRef `json:"pipelineRef"` + PipelineParamsRef PipelineParamsRef `json:"pipelineParamsRef"` + PipelineTriggerRef PipelineTriggerRef `json:"triggerRef"` +} + +// PipelineRef can be used to refer to a specific instance of a Pipeline. +// Copied from CrossVersionObjectReference: https://github.com/kubernetes/kubernetes/blob/169df7434155cbbc22f1532cba8e0a9588e29ad8/pkg/apis/autoscaling/types.go#L64 +type PipelineRef struct { + // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names + Name string `json:"name"` + // API version of the referent + APIVersion string `json:"apiVersion,omitempty"` +} + +// PipelineParamsRef can be used to refer to a specific instance of a Pipeline. +// Copied from CrossVersionObjectReference: https://github.com/kubernetes/kubernetes/blob/169df7434155cbbc22f1532cba8e0a9588e29ad8/pkg/apis/autoscaling/types.go#L64 +type PipelineParamsRef struct { + // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names + Name string `json:"name"` + // API version of the referent + APIVersion string `json:"apiVersion,omitempty"` +} + +// PipelineTriggerType indicates the mechanism by which this PipelineRun was created. +type PipelineTriggerType string + +const ( + // PipelineTriggerTypeManual indicates that this PipelineRun was invoked manually by a user. + PipelineTriggerTypeManual PipelineTriggerType = "manual" +) + +// PipelineTriggerRef describes what triggered this Pipeline to run. It could be triggered manually, +// or it could have been some kind of external event (not yet designed). +type PipelineTriggerRef struct { + Type PipelineTriggerType `json:"type"` + Name string `json:"name,omitempty"` } // PipelineRunStatus defines the observed state of PipelineRun diff --git a/pkg/apis/pipeline/v1beta1/task_types.go b/pkg/apis/pipeline/v1beta1/task_types.go index 28a8ee7fa5d..37bebfec517 100644 --- a/pkg/apis/pipeline/v1beta1/task_types.go +++ b/pkg/apis/pipeline/v1beta1/task_types.go @@ -63,11 +63,19 @@ type SourceInput struct { Name string `json:"name"` } +// ParamType represents the type of the parameter. +type ParamType string + +const ( + // ParamTypeString indicates this parameter is just a string. + ParamTypeString ParamType = "string" +) + // Param defines arbitrary parameters needed by a task beyond typed inputs // such as Sources. type Param struct { - Name string `json:"name"` - Type string `json:"type"` + Name string `json:"name"` + Type ParamType `json:"type"` } // Outputs allow a task to declare what data the Build/Task will be producing, @@ -86,12 +94,21 @@ type TestResult struct { Path string `json:"path"` } +// ArtifactType indicates what type of artifact store this is, so the controller +// will know how to publish artifacts from it. +type ArtifactType string + +const ( + // ArtifactTypeImage indicates that this artifact is a container image. + ArtifactTypeImage ArtifactType = "image" +) + // Artifact allows a Task to describe what artifacts it will be producing // and specify where they will be stored. type Artifact struct { - Name string `json:"name"` - Type string `json:"type"` - StoreKey string `json:"storeKey"` + Name string `json:"name"` + Type ArtifactType `json:"type"` + StoreKey string `json:"storeKey"` } // BuildSpec describes how to create a Build for this Task. diff --git a/pkg/apis/pipeline/v1beta1/taskrun_types.go b/pkg/apis/pipeline/v1beta1/taskrun_types.go index 9fe37c7b97d..2267e9713ed 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_types.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_types.go @@ -21,13 +21,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - // TaskRunSpec defines the desired state of TaskRun type TaskRunSpec struct { TaskRef TaskRef `json:"taskRef"` - Trigger Trigger `json:"trigger"` + Trigger TaskTrigger `json:"trigger"` Inputs TaskRunInputs `json:"inputs,omitempty"` Outputs Outputs `json:"outputs,omitempty"` Results Results `json:"results"` @@ -39,19 +36,32 @@ type TaskRunInputs struct { Params []Param `json:"params,omitempty"` } -// Trigger defines a webhook style trigger to start a TaskRun -type Trigger struct { - TriggerRef TriggerRef `json:"triggerRef"` - PrevTasks []string `json:"prevTasks,omitempty"` - NextTasks []string `json:"nextTasks,omitempty"` +// TaskTrigger defines a webhook style trigger to start a TaskRun +type TaskTrigger struct { + TriggerRef TaskTriggerRef `json:"triggerRef"` + PrevTasks []string `json:"prevTasks,omitempty"` + NextTasks []string `json:"nextTasks,omitempty"` } -// TriggerRef describes what triggered this Task. It could be triggered manually, +// TaskTriggerType indicates the mechanism by which this TaskRun was created. +type TaskTriggerType string + +const ( + // TaskTriggerTypeManual indicates that this TaskRun was invoked manually by a user. + TaskTriggerTypeManual TaskTriggerType = "manual" + + // TaskTriggerTypePipelineRun indicates that this TaskRun was created by a controller + // attempting to realize a PipelineRun. In this case the `name` will refer to the name + // of the PipelineRun. + TaskTriggerTypePipelineRun TaskTriggerType = "pipelineRun" +) + +// TaskTriggerRef describes what triggered this Task to run. It could be triggered manually, // or it may have been part of a PipelineRun in which case this ref would refer // to the corresponding PipelineRun. -type TriggerRef struct { - Type string `json:"type"` - Name string `json:"name,omitempty"` +type TaskTriggerRef struct { + Type TaskTriggerType `json:"type"` + Name string `json:"name,omitempty"` } // TaskRunStatus defines the observed state of TaskRun diff --git a/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go index 83f828e161a..b19d4ad340c 100644 --- a/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go @@ -122,22 +122,6 @@ func (in *Inputs) DeepCopy() *Inputs { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Log) DeepCopyInto(out *Log) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Log. -func (in *Log) DeepCopy() *Log { - if in == nil { - return nil - } - out := new(Log) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Outputs) DeepCopyInto(out *Outputs) { *out = *in @@ -302,6 +286,22 @@ func (in *PipelineParamsList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelineParamsRef) DeepCopyInto(out *PipelineParamsRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineParamsRef. +func (in *PipelineParamsRef) DeepCopy() *PipelineParamsRef { + if in == nil { + return nil + } + out := new(PipelineParamsRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PipelineParamsSpec) DeepCopyInto(out *PipelineParamsSpec) { *out = *in @@ -315,7 +315,7 @@ func (in *PipelineParamsSpec) DeepCopyInto(out *PipelineParamsSpec) { *out = make([]ArtifactStore, len(*in)) copy(*out, *in) } - in.Results.DeepCopyInto(&out.Results) + out.Results = in.Results return } @@ -345,6 +345,22 @@ func (in *PipelineParamsStatus) DeepCopy() *PipelineParamsStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PipelineRef) DeepCopyInto(out *PipelineRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRef. +func (in *PipelineRef) DeepCopy() *PipelineRef { + if in == nil { + return nil + } + out := new(PipelineRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PipelineRun) DeepCopyInto(out *PipelineRun) { *out = *in @@ -426,6 +442,9 @@ func (in *PipelineRunList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PipelineRunSpec) DeepCopyInto(out *PipelineRunSpec) { *out = *in + out.PipelineRef = in.PipelineRef + out.PipelineParamsRef = in.PipelineParamsRef + out.PipelineTriggerRef = in.PipelineTriggerRef return } @@ -629,48 +648,52 @@ func (in *PipelineTaskRunRef) DeepCopy() *PipelineTaskRunRef { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Results) DeepCopyInto(out *Results) { +func (in *PipelineTriggerRef) DeepCopyInto(out *PipelineTriggerRef) { *out = *in - if in.Runs != nil { - in, out := &in.Runs, &out.Runs - *out = make([]Run, len(*in)) - copy(*out, *in) - } - if in.Logs != nil { - in, out := &in.Logs, &out.Logs - *out = make([]Log, len(*in)) - copy(*out, *in) - } - if in.Tests != nil { - in, out := &in.Tests, &out.Tests - *out = make([]Test, len(*in)) - copy(*out, *in) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTriggerRef. +func (in *PipelineTriggerRef) DeepCopy() *PipelineTriggerRef { + if in == nil { + return nil } + out := new(PipelineTriggerRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResultTarget) DeepCopyInto(out *ResultTarget) { + *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Results. -func (in *Results) DeepCopy() *Results { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResultTarget. +func (in *ResultTarget) DeepCopy() *ResultTarget { if in == nil { return nil } - out := new(Results) + out := new(ResultTarget) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Run) DeepCopyInto(out *Run) { +func (in *Results) DeepCopyInto(out *Results) { *out = *in + out.Runs = in.Runs + out.Logs = in.Logs + out.Tests = in.Tests return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Run. -func (in *Run) DeepCopy() *Run { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Results. +func (in *Results) DeepCopy() *Results { if in == nil { return nil } - out := new(Run) + out := new(Results) in.DeepCopyInto(out) return out } @@ -943,7 +966,7 @@ func (in *TaskRunSpec) DeepCopyInto(out *TaskRunSpec) { in.Trigger.DeepCopyInto(&out.Trigger) in.Inputs.DeepCopyInto(&out.Inputs) in.Outputs.DeepCopyInto(&out.Outputs) - in.Results.DeepCopyInto(&out.Results) + out.Results = in.Results return } @@ -1021,76 +1044,60 @@ func (in *TaskStatus) DeepCopy() *TaskStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Test) DeepCopyInto(out *Test) { +func (in *TaskTrigger) DeepCopyInto(out *TaskTrigger) { *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Test. -func (in *Test) DeepCopy() *Test { - if in == nil { - return nil + out.TriggerRef = in.TriggerRef + if in.PrevTasks != nil { + in, out := &in.PrevTasks, &out.PrevTasks + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.NextTasks != nil { + in, out := &in.NextTasks, &out.NextTasks + *out = make([]string, len(*in)) + copy(*out, *in) } - out := new(Test) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TestResult) DeepCopyInto(out *TestResult) { - *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestResult. -func (in *TestResult) DeepCopy() *TestResult { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskTrigger. +func (in *TaskTrigger) DeepCopy() *TaskTrigger { if in == nil { return nil } - out := new(TestResult) + out := new(TaskTrigger) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Trigger) DeepCopyInto(out *Trigger) { +func (in *TaskTriggerRef) DeepCopyInto(out *TaskTriggerRef) { *out = *in - out.TriggerRef = in.TriggerRef - if in.PrevTasks != nil { - in, out := &in.PrevTasks, &out.PrevTasks - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NextTasks != nil { - in, out := &in.NextTasks, &out.NextTasks - *out = make([]string, len(*in)) - copy(*out, *in) - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trigger. -func (in *Trigger) DeepCopy() *Trigger { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskTriggerRef. +func (in *TaskTriggerRef) DeepCopy() *TaskTriggerRef { if in == nil { return nil } - out := new(Trigger) + out := new(TaskTriggerRef) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TriggerRef) DeepCopyInto(out *TriggerRef) { +func (in *TestResult) DeepCopyInto(out *TestResult) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TriggerRef. -func (in *TriggerRef) DeepCopy() *TriggerRef { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestResult. +func (in *TestResult) DeepCopy() *TestResult { if in == nil { return nil } - out := new(TriggerRef) + out := new(TestResult) in.DeepCopyInto(out) return out }