Skip to content

Commit

Permalink
use revertErr instead of err
Browse files Browse the repository at this point in the history
Signed-off-by: Sujal Gupta <[email protected]>
  • Loading branch information
heysujal committed Dec 28, 2024
1 parent 7e08c69 commit 4ca16e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chaoslib/litmus/network-chaos/helper/netem.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func preparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetail
}
log.Infof("successfully injected chaos on target: {name: %s, namespace: %v, container: %v}", t.Name, t.Namespace, t.TargetContainer)
if err = result.AnnotateChaosResult(resultDetails.Name, chaosDetails.ChaosNamespace, "injected", "pod", t.Name); err != nil {
if _, revertErr := killnetem(t, experimentsDetails.NetworkInterface); err != nil {
if _, revertErr := killnetem(t, experimentsDetails.NetworkInterface); revertErr != nil {
return cerrors.PreserveError{ErrString: fmt.Sprintf("[%s,%s]", stacktrace.RootCause(err).Error(), stacktrace.RootCause(revertErr).Error())}
}
return stacktrace.Propagate(err, "could not annotate chaosresult")
Expand Down

0 comments on commit 4ca16e9

Please sign in to comment.