Skip to content

Commit

Permalink
fix: k8sChaos duration should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
miketonks-form3 committed Jan 11, 2024
1 parent 94cfdf0 commit 203d666
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 34 deletions.
3 changes: 2 additions & 1 deletion api/v1alpha1/k8schaos_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ var (
// K8SChaosSpec defines the desired state of K8SChaos
type K8SChaosSpec struct {
// Duration represents the duration of the chaos action
Duration *string `json:"duration" webhook:"Duration"`
// +optional
Duration *string `json:"duration,omitempty" webhook:"Duration"`

// +kubebuilder:validation:Required
APIObjects *K8SChaosAPIObjects `json:"apiObjects"`
Expand Down
1 change: 0 additions & 1 deletion config/crd/bases/chaos-mesh.org_k8schaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
status:
description: Most recently observed status of the chaos experiment about
Expand Down
3 changes: 0 additions & 3 deletions config/crd/bases/chaos-mesh.org_schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -4595,7 +4594,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of
Expand Down Expand Up @@ -7725,7 +7723,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/chaos-mesh.org_workflownodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -4186,7 +4185,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -7622,7 +7620,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state
Expand Down Expand Up @@ -10856,7 +10853,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired
Expand Down
2 changes: 0 additions & 2 deletions config/crd/bases/chaos-mesh.org_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -4350,7 +4349,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of
Expand Down
1 change: 0 additions & 1 deletion helm/chaos-mesh/crds/chaos-mesh.org_k8schaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
status:
description: Most recently observed status of the chaos experiment about
Expand Down
3 changes: 0 additions & 3 deletions helm/chaos-mesh/crds/chaos-mesh.org_schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -4595,7 +4594,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of
Expand Down Expand Up @@ -7725,7 +7723,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state
Expand Down
4 changes: 0 additions & 4 deletions helm/chaos-mesh/crds/chaos-mesh.org_workflownodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -4186,7 +4185,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -7622,7 +7620,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state
Expand Down Expand Up @@ -10856,7 +10853,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired
Expand Down
2 changes: 0 additions & 2 deletions helm/chaos-mesh/crds/chaos-mesh.org_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -4350,7 +4349,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of
Expand Down
10 changes: 0 additions & 10 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2263,7 +2263,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
status:
description: Most recently observed status of the chaos experiment about
Expand Down Expand Up @@ -6639,7 +6638,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -10002,7 +10000,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of
Expand Down Expand Up @@ -13132,7 +13129,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state
Expand Down Expand Up @@ -21290,7 +21286,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -24223,7 +24218,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -27659,7 +27653,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state
Expand Down Expand Up @@ -30893,7 +30886,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired
Expand Down Expand Up @@ -41984,7 +41976,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of KernelChaos
Expand Down Expand Up @@ -45031,7 +45022,6 @@ spec:
type: string
required:
- apiObjects
- duration
type: object
kernelChaos:
description: KernelChaosSpec defines the desired state of
Expand Down
2 changes: 1 addition & 1 deletion pkg/dashboard/swaggerdocs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6054,7 +6054,7 @@ const docTemplate = `{
"$ref": "#/definitions/v1alpha1.K8SChaosAPIObjects"
},
"duration": {
"description": "Duration represents the duration of the chaos action",
"description": "Duration represents the duration of the chaos action\n+optional",
"type": "string"
},
"remoteCluster": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dashboard/swaggerdocs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6046,7 +6046,7 @@
"$ref": "#/definitions/v1alpha1.K8SChaosAPIObjects"
},
"duration": {
"description": "Duration represents the duration of the chaos action",
"description": "Duration represents the duration of the chaos action\n+optional",
"type": "string"
},
"remoteCluster": {
Expand Down
4 changes: 3 additions & 1 deletion pkg/dashboard/swaggerdocs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4313,7 +4313,9 @@ definitions:
$ref: '#/definitions/v1alpha1.K8SChaosAPIObjects'
description: +kubebuilder:validation:Required
duration:
description: Duration represents the duration of the chaos action
description: |-
Duration represents the duration of the chaos action
+optional
type: string
remoteCluster:
description: |-
Expand Down

0 comments on commit 203d666

Please sign in to comment.