-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support duration chaos for pod failure #175
Support duration chaos for pod failure #175
Conversation
Codecov Report
@@ Coverage Diff @@
## master #175 +/- ##
=========================================
Coverage ? 39.47%
=========================================
Files ? 17
Lines ? 608
Branches ? 0
=========================================
Hits ? 240
Misses ? 337
Partials ? 31 Continue to review full report at Codecov.
|
@@ -15,7 +15,6 @@ package podfailure | |||
|
|||
import ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make a dir named controllers/scheduler/podchaos
controllers/duration/types.go
Outdated
return r.Update(ctx, chaos) | ||
}) | ||
if updateError != nil { | ||
r.Log.Error(updateError, "unable to update chaos finalizers") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we need return updateError here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to, this reconciliation would be re queued in the end.
Client: r.Client, | ||
Log: r.Log, | ||
} | ||
return reconciler.Reconcile(req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a little redundant, how about merge these two parts into one constructor method?
@Yisaer I think the name |
@Yisaer I think we can rename |
@cwen0 It's ok for me to rename both |
Great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
I find both |
Co-Authored-By: mahjonp <[email protected]>
Co-Authored-By: mahjonp <[email protected]>
…ub.com/Yisaer/chaos-mesh into support_duration_chaos_for_pod_failure
The wrap here is to implement the interface like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-Authored-By: mahjonp <[email protected]>
@cwen0 PTAL again |
r.Log.Error(err, fmt.Sprintf("unable to get podchaos[%s/%s]'s duration", podchaos.Namespace, podchaos.Name)) | ||
return ctrl.Result{}, nil | ||
} | ||
if scheduler == nil && duration == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about pod-kill
action? Duration
is always empty for pod-kill
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch and updated.
@cwen0 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
#171
Make
Podfailure chaos
support duration chaos feature.What is changed and how does it work?
Adding a new controller interface as
duration controller
liketwophase controller
to control the logic of duration chaos. Each kind of chaos would implement both interfaces.Check List
Tests
Code changes
Side effects
Related changes
Does this PR introduce a user-facing change?: