From 07598eeb1cd5d8281b34ed99c9656c68a51898d5 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 11f89a4b63f..923318413a2 100644 --- a/docs/pipeline-api.md +++ b/docs/pipeline-api.md @@ -2229,7 +2229,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the PipelineRun is actually started.

@@ -2243,7 +2242,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the PipelineRun completed.

@@ -2326,6 +2324,7 @@ Provenance +(Optional)

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

@@ -5018,7 +5017,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the build is actually started.

@@ -5032,7 +5030,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the build completed.

@@ -5116,6 +5113,7 @@ Provenance +(Optional)

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

@@ -9896,7 +9894,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the PipelineRun is actually started.

@@ -9910,7 +9907,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the PipelineRun completed.

@@ -10023,6 +10019,7 @@ Provenance +(Optional)

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

@@ -13355,7 +13352,6 @@ Kubernetes meta/v1.Time -(Optional)

StartTime is the time the build is actually started.

@@ -13369,7 +13365,6 @@ Kubernetes meta/v1.Time -(Optional)

CompletionTime is the time the build completed.

@@ -13483,6 +13478,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 6fcd7622cba..a4262d55e92 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 060823c6cc4..d661ab465c6 100644 --- a/pkg/apis/pipeline/v1/taskrun_types.go +++ b/pkg/apis/pipeline/v1/taskrun_types.go @@ -203,11 +203,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. @@ -235,6 +233,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 442f65fefeb..8f514eb0793 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go @@ -417,11 +417,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. @@ -457,6 +455,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 5253c651676..ce3a7a9849d 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_types.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_types.go @@ -241,11 +241,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. @@ -285,6 +283,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"` }