Skip to content

Commit

Permalink
use context with timeout from rootArgs
Browse files Browse the repository at this point in the history
Signed-off-by: Chanwit Kaewkasi <[email protected]>
  • Loading branch information
chanwit committed Nov 7, 2023
1 parent 6532989 commit 9458616
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/flamingo/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ func installFluxSubsystemForArgo(candidate Candidate, installMode string, anonym
// install everything
logger.Actionf("installing components in %s namespace", rootArgs.applicationNamespace)
}
applyOutput, err := utils.Apply(context.Background(), kubeconfigArgs, kubeclientOptions, yamlOutput)

ctx, cancelFn := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancelFn()
applyOutput, err := utils.Apply(ctx, kubeconfigArgs, kubeclientOptions, yamlOutput)
if err != nil {
return fmt.Errorf("install failed: %w", err)
}
Expand Down

0 comments on commit 9458616

Please sign in to comment.