From b72bd1f84327db1fa4644e2e6098d721a55f89ee Mon Sep 17 00:00:00 2001 From: Christie Wilson Date: Mon, 3 Dec 2018 14:55:08 -0800 Subject: [PATCH] Make results in Run `status` optional If it's optional in the spec, it should probably be optional in the Status, since the behaviour would probably be not to upload the logs anywhere if no endpoint is provided. Possibly in the future these could become mandator, depending how we design the results store interface. --- .../pipeline/v1alpha1/pipelinerun_types.go | 3 ++- pkg/apis/pipeline/v1alpha1/taskrun_types.go | 3 ++- .../v1alpha1/zz_generated.deepcopy.go | 20 +++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go b/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go index 43f3e582fc1..eb6a76dcb88 100644 --- a/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go @@ -112,7 +112,8 @@ type PipelineTriggerRef struct { type PipelineRunStatus struct { Conditions duckv1alpha1.Conditions `json:"conditions"` // In #107 should be updated to hold the location logs have been uploaded to - Results Results `json:"results"` + // +optional + Results *Results `json:"results,omitempty"` // map of TaskRun Status with the taskRun name as the key //+optional TaskRuns map[string]TaskRunStatus `json:"taskRuns,omitempty"` diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_types.go b/pkg/apis/pipeline/v1alpha1/taskrun_types.go index 658c2172245..25b84925cd6 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_types.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_types.go @@ -105,7 +105,8 @@ type TaskRunStatus struct { Conditions duckv1alpha1.Conditions `json:"conditions,omitempty"` // In #107 should be updated to hold the location logs have been uploaded to - Results Results `json:"results"` + // +optional + Results *Results `json:"results,omitempty"` // PodName is the name of the pod responsible for executing this task's steps. PodName string `json:"podName"` diff --git a/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go index 8c60598a6da..7c33d5a90c6 100644 --- a/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go @@ -454,7 +454,15 @@ func (in *PipelineRunStatus) DeepCopyInto(out *PipelineRunStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - out.Results = in.Results + if in.Results != nil { + in, out := &in.Results, &out.Results + if *in == nil { + *out = nil + } else { + *out = new(Results) + **out = **in + } + } if in.TaskRuns != nil { in, out := &in.TaskRuns, &out.TaskRuns *out = make(map[string]TaskRunStatus, len(*in)) @@ -1010,7 +1018,15 @@ func (in *TaskRunStatus) DeepCopyInto(out *TaskRunStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - out.Results = in.Results + if in.Results != nil { + in, out := &in.Results, &out.Results + if *in == nil { + *out = nil + } else { + *out = new(Results) + **out = **in + } + } if in.StartTime != nil { in, out := &in.StartTime, &out.StartTime if *in == nil {