-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Termination grace period is multiplied by time.Second erronously #5046
Comments
Sorry, I don't understand what the issue is. Do you mean that the terminationGracePeriodDuration should embed the time.Second information |
const (
Nanosecond Duration = 1
Microsecond = 1000 * Nanosecond
Millisecond = 1000 * Microsecond
Second = 1000 * Millisecond
Minute = 60 * Second
Hour = 60 * Minute
) 10 seconds * 10 seconds = 1000 * Millisecond * 1000 * Millisecond = a very big number and not what I think you want |
It is working like this at the moment
The terminationGracePeriodDuration is a multiplier factor I think we are using it correctly |
What about my example?
|
Should |
Yes, your example does produce a very big number but in our case, we are casting it using time.Duration instead of time.Second
*pod.Spec.TerminationGracePeriodSeconds is int64 |
To be clear, It NEVER makes sense to multiple This is the fix to the code: terminationGracePeriodDuration := *pod.Spec.TerminationGracePeriodSeconds * time.Second |
ok, I get your points now. |
Signed-off-by: Alex Collins <[email protected]>
Signed-off-by: Alex Collins <[email protected]>
Signed-off-by: Alex Collins <[email protected]>
Signed-off-by: Alex Collins <[email protected]>
@tczhao
The text was updated successfully, but these errors were encountered: