@@ -611,8 +611,8 @@ func (r *KustomizationReconciler) validate(ctx context.Context, kustomization ku
611611 command := exec .CommandContext (applyCtx , "/bin/sh" , "-c" , cmd )
612612 output , err := command .CombinedOutput ()
613613 if err != nil {
614- if errors .Is (err , context .DeadlineExceeded ) {
615- return fmt .Errorf ("validation timeout: %w" , err )
614+ if errors .Is (applyCtx . Err () , context .DeadlineExceeded ) {
615+ return fmt .Errorf ("validation timeout: %w" , applyCtx . Err () )
616616 }
617617 return fmt .Errorf ("validation failed: %s" , parseApplyError (output ))
618618 }
@@ -651,8 +651,8 @@ func (r *KustomizationReconciler) apply(ctx context.Context, kustomization kusto
651651 command := exec .CommandContext (applyCtx , "/bin/sh" , "-c" , cmd )
652652 output , err := command .CombinedOutput ()
653653 if err != nil {
654- if errors .Is (err , context .DeadlineExceeded ) {
655- return "" , fmt .Errorf ("apply timeout: %w" , err )
654+ if errors .Is (applyCtx . Err () , context .DeadlineExceeded ) {
655+ return "" , fmt .Errorf ("apply timeout: %w" , applyCtx . Err () )
656656 }
657657
658658 if string (output ) == "" {
0 commit comments