From e8d6d500dd01a6b52b9e5e9b920c9fe85e6519da Mon Sep 17 00:00:00 2001 From: Chuang Wang Date: Wed, 30 Nov 2022 13:28:42 -0800 Subject: [PATCH] Correct required v.s. optional fields in run status Fixes https://github.com/tektoncd/pipeline/issues/5818. Prior, `startTime` and `completionTime` are marked as optional fields in Run status, and `provenance` field was not marked as optional in Run status. Now, we remove `+optional` tag for `startTime` and `completionTime` in Run status, and add `+optional` tag for the `provenance` field. Signed-off-by: Chuang Wang --- docs/pipeline-api.md | 12 ++++-------- pkg/apis/pipeline/v1/pipelinerun_types.go | 3 +-- pkg/apis/pipeline/v1/taskrun_types.go | 3 +-- pkg/apis/pipeline/v1beta1/pipelinerun_types.go | 3 +-- pkg/apis/pipeline/v1beta1/taskrun_types.go | 3 +-- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/pipeline-api.md b/docs/pipeline-api.md index c922adeda39..d7957df6919 100644 --- a/docs/pipeline-api.md +++ b/docs/pipeline-api.md @@ -2217,7 +2217,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the PipelineRun is actually started.

@@ -2231,7 +2230,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the PipelineRun completed.

@@ -2314,6 +2312,7 @@ Provenance +(Optional)

Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).

@@ -4991,7 +4990,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the build is actually started.

@@ -5005,7 +5003,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the build completed.

@@ -5089,6 +5086,7 @@ Provenance +(Optional)

Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).

@@ -9582,7 +9580,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the PipelineRun is actually started.

@@ -9596,7 +9593,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the PipelineRun completed.

@@ -9709,6 +9705,7 @@ Provenance +(Optional)

Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).

@@ -13024,7 +13021,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the build is actually started.

@@ -13038,7 +13034,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the build completed.

@@ -13152,6 +13147,7 @@ Provenance +(Optional)

Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).

diff --git a/pkg/apis/pipeline/v1/pipelinerun_types.go b/pkg/apis/pipeline/v1/pipelinerun_types.go index 2a4fe0c2618..9df2ef06340 100644 --- a/pkg/apis/pipeline/v1/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1/pipelinerun_types.go @@ -399,11 +399,9 @@ type ChildStatusReference struct { // consume these fields via duck typing. type PipelineRunStatusFields struct { // StartTime is the time the PipelineRun is actually started. - // +optional StartTime *metav1.Time `json:"startTime,omitempty"` // CompletionTime is the time the PipelineRun completed. - // +optional CompletionTime *metav1.Time `json:"completionTime,omitempty"` // Results are the list of results written out by the pipeline task's containers @@ -429,6 +427,7 @@ type PipelineRunStatusFields struct { FinallyStartTime *metav1.Time `json:"finallyStartTime,omitempty"` // Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.). + // +optional Provenance *Provenance `json:"provenance,omitempty"` } diff --git a/pkg/apis/pipeline/v1/taskrun_types.go b/pkg/apis/pipeline/v1/taskrun_types.go index bf29a836425..9218a811ac3 100644 --- a/pkg/apis/pipeline/v1/taskrun_types.go +++ b/pkg/apis/pipeline/v1/taskrun_types.go @@ -201,11 +201,9 @@ type TaskRunStatusFields struct { PodName string `json:"podName"` // StartTime is the time the build is actually started. - // +optional StartTime *metav1.Time `json:"startTime,omitempty"` // CompletionTime is the time the build completed. - // +optional CompletionTime *metav1.Time `json:"completionTime,omitempty"` // Steps describes the state of each build step container. @@ -233,6 +231,7 @@ type TaskRunStatusFields struct { TaskSpec *TaskSpec `json:"taskSpec,omitempty"` // Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.). + // +optional Provenance *Provenance `json:"provenance,omitempty"` } diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_types.go b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go index c8cb9198130..fd521b0506b 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go @@ -418,11 +418,9 @@ type ChildStatusReference struct { // consume these fields via duck typing. type PipelineRunStatusFields struct { // StartTime is the time the PipelineRun is actually started. - // +optional StartTime *metav1.Time `json:"startTime,omitempty"` // CompletionTime is the time the PipelineRun completed. - // +optional CompletionTime *metav1.Time `json:"completionTime,omitempty"` // Deprecated - use ChildReferences instead. @@ -458,6 +456,7 @@ type PipelineRunStatusFields struct { FinallyStartTime *metav1.Time `json:"finallyStartTime,omitempty"` // Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.). + // +optional Provenance *Provenance `json:"provenance,omitempty"` } diff --git a/pkg/apis/pipeline/v1beta1/taskrun_types.go b/pkg/apis/pipeline/v1beta1/taskrun_types.go index 8c70b63f30c..a65f962f166 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_types.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_types.go @@ -232,11 +232,9 @@ type TaskRunStatusFields struct { PodName string `json:"podName"` // StartTime is the time the build is actually started. - // +optional StartTime *metav1.Time `json:"startTime,omitempty"` // CompletionTime is the time the build completed. - // +optional CompletionTime *metav1.Time `json:"completionTime,omitempty"` // Steps describes the state of each build step container. @@ -276,6 +274,7 @@ type TaskRunStatusFields struct { TaskSpec *TaskSpec `json:"taskSpec,omitempty"` // Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.). + // +optional Provenance *Provenance `json:"provenance,omitempty"` }