You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1beta1/disruption_types.go
+36-5Lines changed: 36 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,10 @@ type DisruptionSpec struct {
58
58
// +nullable
59
59
Pulse*DisruptionPulse`json:"pulse,omitempty"`// enable pulsing diruptions and specify the duration of the active state and the dormant state of the pulsing duration
60
60
DurationDisruptionDuration`json:"duration,omitempty"`// time from disruption creation until chaos pods are deleted and no more are created
61
+
// MaxRuns specifies the maximum number of times the disruption should be executed
62
+
// After this many runs, the disruption will become idle (default: unlimited for continuous disruptions)
63
+
// +kubebuilder:validation:Minimum=1
64
+
MaxRuns*int`json:"maxRuns,omitempty"`
61
65
// Level defines what the disruption will target, either a pod or a node
retErr=multierror.Append(retErr, errors.New("container failure disruptions are not compatible with other disruption kinds. The container failure will remove the impact of the other disruption types"))
retErr=multierror.Append(retErr, errors.New("node failure disruptions are not compatible with other disruption kinds. The node failure will remove the impact of the other disruption types"))
retErr=multierror.Append(retErr, errors.New("pod replacement disruptions are not compatible with other disruption kinds. The pod replacement will remove the impact of the other disruption types"))
717
+
}
718
+
// Rule: container failure not possible if disruption is node-level
719
+
ifs.Level==chaostypes.DisruptionLevelNode {
720
+
retErr=multierror.Append(retErr, errors.New("cannot execute a pod replacement because the level configuration is set to node"))
721
+
}
722
+
}
723
+
706
724
// Rule: on init compatibility
707
725
ifs.OnInit {
708
726
ifs.CPUPressure!=nil||
709
727
s.NodeFailure!=nil||
728
+
s.PodReplacement!=nil||
710
729
s.ContainerFailure!=nil||
711
730
s.DiskPressure!=nil||
712
731
s.GRPC!=nil||
@@ -756,7 +775,7 @@ func (s DisruptionSpec) validateGlobalDisruptionScope(requireSelectors bool) (re
0 commit comments