Skip to content

Commit

Permalink
fix: Template in Lifecycle hook should be optional (#8735)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan authored and sarabala1979 committed Jun 20, 2022
1 parent f10d623 commit a1ba421
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 57 deletions.
3 changes: 0 additions & 3 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5953,9 +5953,6 @@
"description": "TemplateRef is the reference to the template resource to execute by the hook"
}
},
"required": [
"template"
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.Link": {
Expand Down
3 changes: 0 additions & 3 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10206,9 +10206,6 @@
},
"io.argoproj.workflow.v1alpha1.LifecycleHook": {
"type": "object",
"required": [
"template"
],
"properties": {
"arguments": {
"description": "Arguments hold arguments to the template",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
hostAliases:
Expand Down Expand Up @@ -4202,8 +4200,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -10863,8 +10859,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down
6 changes: 0 additions & 6 deletions manifests/base/crds/full/argoproj.io_cronworkflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1235,8 +1235,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
hostAliases:
Expand Down Expand Up @@ -4223,8 +4221,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -10884,8 +10880,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down
14 changes: 0 additions & 14 deletions manifests/base/crds/full/argoproj.io_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
hostAliases:
Expand Down Expand Up @@ -4211,8 +4209,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -10872,8 +10868,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -20605,8 +20599,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -25768,8 +25760,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
hostAliases:
Expand Down Expand Up @@ -28756,8 +28746,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -35417,8 +35405,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down
2 changes: 0 additions & 2 deletions manifests/base/crds/full/argoproj.io_workflowtasksets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2714,8 +2714,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down
6 changes: 0 additions & 6 deletions manifests/base/crds/full/argoproj.io_workflowtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
hostAliases:
Expand Down Expand Up @@ -4201,8 +4199,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down Expand Up @@ -10862,8 +10858,6 @@ spec:
template:
type: string
type: object
required:
- template
type: object
type: object
inline: {}
Expand Down
2 changes: 0 additions & 2 deletions pkg/apis/workflow/v1alpha1/openapi_generated.go

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

2 changes: 1 addition & 1 deletion pkg/apis/workflow/v1alpha1/workflow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ func (lchs LifecycleHooks) HasExitHook() bool {

type LifecycleHook struct {
// Template is the name of the template to execute by the hook
Template string `json:"template," protobuf:"bytes,1,opt,name=template"`
Template string `json:"template,omitempty" protobuf:"bytes,1,opt,name=template"`
// Arguments hold arguments to the template
Arguments Arguments `json:"arguments,omitempty" protobuf:"bytes,2,opt,name=arguments"`
// TemplateRef is the reference to the template resource to execute by the hook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arguments** | [**IoArgoprojWorkflowV1alpha1Arguments**](IoArgoprojWorkflowV1alpha1Arguments.md) | | [optional]
**expression** | **String** | Expression is a condition expression for when a node will be retried. If it evaluates to false, the node will not be retried and the retry strategy will be ignored | [optional]
**template** | **String** | Template is the name of the template to execute by the hook |
**template** | **String** | Template is the name of the template to execute by the hook | [optional]
**templateRef** | [**IoArgoprojWorkflowV1alpha1TemplateRef**](IoArgoprojWorkflowV1alpha1TemplateRef.md) | | [optional]


Expand Down

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

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

0 comments on commit a1ba421

Please sign in to comment.