Skip to content

Commit

Permalink
fix: add timeout for executor signal (#13012)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuping Fan <coderfyp@gmail.com>
Signed-off-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com>
Co-authored-by: Yuping Fan <coderfyp@gmail.com>
Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com>
  • Loading branch information
3 people committed May 16, 2024
1 parent 9f620d7 commit adef075
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 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,9 @@ func ExecPodContainerAndGetOutput(ctx context.Context, restConfig *rest.Config,
if err != nil {
return err
}
// workaround for when exec does not properly return: https://github.com/kubernetes/kubernetes/pull/103177
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 adef075

Please sign in to comment.