Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
fix changes
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
  • Loading branch information
shubham-cmyk committed Sep 15, 2023
1 parent 287e12c commit 3b415f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/test/utils/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,10 @@ func RunCommand(ctx context.Context, namespace string, cmd harness.Command, cwd
if err != nil {
return nil, fmt.Errorf("command %q with %w", cmd.Command, err)
}

// Check if command is running in background and has an output validation
if cmd.Background && cmd.Output != nil {
return nil, errors.New("background commands cannot have an output validation")
}
kuttlENV := make(map[string]string)
kuttlENV["NAMESPACE"] = namespace
kuttlENV["KUBECONFIG"] = kubeconfigPath(actualDir, kubeconfigOverride)
Expand Down Expand Up @@ -1113,10 +1116,7 @@ func RunCommand(ctx context.Context, namespace string, cmd harness.Command, cwd
}

if cmd.Output != nil {
err1 := cmd.Output.ValidateCommandOutput(stdoutOutput, stderrOutput)
if err1 != nil {
return nil, err1
}
return nil, cmd.Output.ValidateCommandOutput(stdoutOutput, stderrOutput)
}
return nil, err
}
Expand Down

0 comments on commit 3b415f2

Please sign in to comment.