Skip to content

Commit

Permalink
Bring Retries and RetriesStatus back
Browse files Browse the repository at this point in the history
Prior to this commit, we excluded the `Retries` and `RetriesStatus`
because we were not sure what decisions would be make in TEP-0121,
Now that we've decided to keep both in TEP-0121, we can safely
release Custom Task Beta with them.
  • Loading branch information
XinruZhang authored and tekton-robot committed Nov 18, 2022
1 parent 7d93c4b commit 96d38d5
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 2 deletions.
38 changes: 38 additions & 0 deletions docs/pipeline-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7076,6 +7076,18 @@ CustomRunSpecStatusMessage
</tr>
<tr>
<td>
<code>retries</code><br/>
<em>
int
</em>
</td>
<td>
<em>(Optional)</em>
<p>Used for propagating retries count to custom tasks</p>
</td>
</tr>
<tr>
<td>
<code>serviceAccountName</code><br/>
<em>
string
Expand Down Expand Up @@ -8322,6 +8334,18 @@ CustomRunSpecStatusMessage
</tr>
<tr>
<td>
<code>retries</code><br/>
<em>
int
</em>
</td>
<td>
<em>(Optional)</em>
<p>Used for propagating retries count to custom tasks</p>
</td>
</tr>
<tr>
<td>
<code>serviceAccountName</code><br/>
<em>
string
Expand Down Expand Up @@ -13909,6 +13933,20 @@ tasks in a pipeline.</p>
</tr>
<tr>
<td>
<code>retriesStatus</code><br/>
<em>
<a href="#tekton.dev/v1beta1.CustomRunStatus">
[]CustomRunStatus
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>RetriesStatus contains the history of CustomRunStatus, in case of a retry.</p>
</td>
</tr>
<tr>
<td>
<code>extraFields</code><br/>
<em>
k8s.io/apimachinery/pkg/runtime.RawExtension
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/pipeline/v1beta1/customrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ type CustomRunSpec struct {
// +optional
StatusMessage CustomRunSpecStatusMessage `json:"statusMessage,omitempty"`

// Used for propagating retries count to custom tasks
// +optional
Retries int `json:"retries,omitempty"`

// +optional
ServiceAccountName string `json:"serviceAccountName"`

Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/pipeline/v1beta1/customrun_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ kind: CustomRun
metadata:
name: run
spec:
retries: 3
customRef:
apiVersion: example.dev/v0
kind: Example
Expand Down Expand Up @@ -227,6 +228,7 @@ status:
Name: "run",
},
Spec: v1beta1.CustomRunSpec{
Retries: 3,
CustomRef: &v1beta1.TaskRef{
APIVersion: "example.dev/v0",
Kind: "Example",
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/pipeline/v1beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/pipeline/v1beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@
},
"x-kubernetes-list-type": "atomic"
},
"retries": {
"description": "Used for propagating retries count to custom tasks",
"type": "integer",
"format": "int32"
},
"serviceAccountName": {
"type": "string",
"default": ""
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/run/v1beta1/customrunstatus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ type CustomRunStatusFields struct {
// +optional
Results []CustomRunResult `json:"results,omitempty"`

// RetriesStatus contains the history of CustomRunStatus, in case of a retry.
// +optional
RetriesStatus []CustomRunStatus `json:"retriesStatus,omitempty"`

// ExtraFields holds arbitrary fields provided by the custom task
// controller.
ExtraFields runtime.RawExtension `json:"extraFields,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions test/artifact_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ metadata:
spec:
params:
- name: Url
value: https://github.com/pivotal-nader-ziada/gohelloworld
value: https://github.com/pivotal-nader-ziada/gohelloworld
- name: Revision
value: master
value: master
type: git
`, helloworldResourceName))
if _, err := c.V1alpha1PipelineResourceClient.Create(ctx, helloworldResource, metav1.CreateOptions{}); err != nil {
Expand Down

0 comments on commit 96d38d5

Please sign in to comment.