Skip to content

Commit

Permalink
Correct required v.s. optional fields in run status
Browse files Browse the repository at this point in the history
Fixes tektoncd#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 <[email protected]>
  • Loading branch information
chuangw6 committed Nov 30, 2022
1 parent 83af167 commit e8d6d50
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions docs/pipeline-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>StartTime is the time the PipelineRun is actually started.</p>
</td>
</tr>
Expand All @@ -2231,7 +2230,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>CompletionTime is the time the PipelineRun completed.</p>
</td>
</tr>
Expand Down Expand Up @@ -2314,6 +2312,7 @@ Provenance
</em>
</td>
<td>
<em>(Optional)</em>
<p>Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).</p>
</td>
</tr>
Expand Down Expand Up @@ -4991,7 +4990,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>StartTime is the time the build is actually started.</p>
</td>
</tr>
Expand All @@ -5005,7 +5003,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>CompletionTime is the time the build completed.</p>
</td>
</tr>
Expand Down Expand Up @@ -5089,6 +5086,7 @@ Provenance
</em>
</td>
<td>
<em>(Optional)</em>
<p>Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).</p>
</td>
</tr>
Expand Down Expand Up @@ -9582,7 +9580,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>StartTime is the time the PipelineRun is actually started.</p>
</td>
</tr>
Expand All @@ -9596,7 +9593,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>CompletionTime is the time the PipelineRun completed.</p>
</td>
</tr>
Expand Down Expand Up @@ -9709,6 +9705,7 @@ Provenance
</em>
</td>
<td>
<em>(Optional)</em>
<p>Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).</p>
</td>
</tr>
Expand Down Expand Up @@ -13024,7 +13021,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>StartTime is the time the build is actually started.</p>
</td>
</tr>
Expand All @@ -13038,7 +13034,6 @@ Kubernetes meta/v1.Time
</em>
</td>
<td>
<em>(Optional)</em>
<p>CompletionTime is the time the build completed.</p>
</td>
</tr>
Expand Down Expand Up @@ -13152,6 +13147,7 @@ Provenance
</em>
</td>
<td>
<em>(Optional)</em>
<p>Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).</p>
</td>
</tr>
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/pipeline/v1/pipelinerun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"`
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/pipeline/v1/taskrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"`
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/pipeline/v1beta1/pipelinerun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"`
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/pipeline/v1beta1/taskrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"`
}

Expand Down

0 comments on commit e8d6d50

Please sign in to comment.