Skip to content

Commit

Permalink
fix: add timeout for executor signal
Browse files Browse the repository at this point in the history
Signed-off-by: Yuping Fan <[email protected]>
  • Loading branch information
fyp711 committed May 11, 2024
1 parent 6182386 commit 9efa627
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions workflow/signal/signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path/filepath"
"strings"
"syscall"
"time"

log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -49,6 +50,8 @@ func ExecPodContainerAndGetOutput(ctx context.Context, restConfig *rest.Config,
if err != nil {
return err
}
ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
defer cancel()
stdout, stderr, err := common.GetExecutorOutput(ctx, x)
log.
WithField("namespace", namespace).
Expand Down

0 comments on commit 9efa627

Please sign in to comment.