Skip to content

Commit

Permalink
fix(executor): Correct usage of time.Duration. Fixes argoproj#5046
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec committed Feb 9, 2021
1 parent da0e5cb commit e028ad5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,10 @@ func (we *WorkflowExecutor) GetSecrets(ctx context.Context, namespace, name, key
// GetTerminationGracePeriodDuration returns the terminationGracePeriodSeconds of podSpec in Time.Duration format
func (we *WorkflowExecutor) GetTerminationGracePeriodDuration(ctx context.Context) (time.Duration, error) {
pod, err := we.getPod(ctx)
if err != nil {
if err != nil || pod.Spec.TerminationGracePeriodSeconds == nil {
return time.Duration(0), err
}
terminationGracePeriodDuration := time.Second * time.Duration(*pod.Spec.TerminationGracePeriodSeconds))
terminationGracePeriodDuration := time.Second * time.Duration(*pod.Spec.TerminationGracePeriodSeconds)
return terminationGracePeriodDuration, nil
}

Expand Down

0 comments on commit e028ad5

Please sign in to comment.