-
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
automatically calculate duration #375
Conversation
Signed-off-by: Yang Keao <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #375 +/- ##
=======================================
Coverage 56.93% 56.93%
=======================================
Files 60 60
Lines 3820 3820
=======================================
Hits 2175 2175
Misses 1471 1471
Partials 174 174 Continue to review full report at Codecov.
|
@@ -285,11 +286,19 @@ func (r *Reconciler) applyContainer(ctx context.Context, client chaosdaemon.Chao | |||
return err | |||
} | |||
|
|||
r.Log.Info("setting time shift", "mask", mask, "sec", chaos.Spec.TimeOffset.Sec, "nsec", chaos.Spec.TimeOffset.NSec) | |||
duration, err := time.ParseDuration(chaos.Spec.TimeOffset) |
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.
split this logic to a single help function? So we can add the unit test for this.
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.
Yes!
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
timeOffset: | ||
sec: 100000 | ||
nsec: 100000 | ||
timeOffset: "-10m100ns" |
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.
Remember to update the Wiki
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
Signed-off-by: Yang Keao <[email protected]>
Signed-off-by: Yang Keao <[email protected]>
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
Signed-off-by: Yang Keao [email protected]
What problem does this PR solve?
Calculate time chaos offset automatically.
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
Does this PR introduce a user-facing change?:
Should use new form of
timeOffset
field.