@@ -45,6 +45,9 @@ type PodPartitionCfg struct {
4545 ExperimentCreateDelay time.Duration
4646}
4747
48+ // RunPodPartition initiates a network partition chaos experiment on specified pods.
49+ // It configures the experiment based on the provided PodPartitionCfg and executes it.
50+ // This function is useful for testing the resilience of applications under network partition scenarios.
4851func (cr * NamespaceScopedChaosRunner ) RunPodPartition (ctx context.Context , cfg PodPartitionCfg ) (* Chaos , error ) {
4952 experiment , err := NewChaos (ChaosOpts {
5053 Object : & v1alpha1.NetworkChaos {
@@ -115,6 +118,9 @@ type PodDelayCfg struct {
115118 ExperimentCreateDelay time.Duration
116119}
117120
121+ // RunPodDelay initiates a network delay chaos experiment on specified pods.
122+ // It configures the delay parameters and applies them to the targeted namespace.
123+ // This function is useful for testing the resilience of applications under network latency conditions.
118124func (cr * NamespaceScopedChaosRunner ) RunPodDelay (ctx context.Context , cfg PodDelayCfg ) (* Chaos , error ) {
119125 experiment , err := NewChaos (ChaosOpts {
120126 Object : & v1alpha1.NetworkChaos {
@@ -174,6 +180,9 @@ type PodFailCfg struct {
174180 ExperimentCreateDelay time.Duration
175181}
176182
183+ // RunPodFail initiates a pod failure experiment based on the provided configuration.
184+ // It creates a Chaos object that simulates pod failures for a specified duration,
185+ // allowing users to test the resilience of their applications under failure conditions.
177186func (cr * NamespaceScopedChaosRunner ) RunPodFail (ctx context.Context , cfg PodFailCfg ) (* Chaos , error ) {
178187 experiment , err := NewChaos (ChaosOpts {
179188 Description : cfg .Description ,
@@ -233,6 +242,9 @@ type NodeCPUStressConfig struct {
233242 ExperimentCreateDelay time.Duration
234243}
235244
245+ // RunPodStressCPU initiates a CPU stress test on specified pods within a namespace.
246+ // It creates a scheduled chaos experiment that applies CPU load based on the provided configuration.
247+ // This function is useful for testing the resilience of applications under CPU stress conditions.
236248func (cr * NamespaceScopedChaosRunner ) RunPodStressCPU (ctx context.Context , cfg NodeCPUStressConfig ) (* Chaos , error ) {
237249 experiment , err := NewChaos (ChaosOpts {
238250 Description : cfg .Description ,
0 commit comments