Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed the error we see while running the package(s) in dry-mode #679

Merged
merged 3 commits into from
Jun 7, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ func (executor *StartosisExecutor) Execute(ctx context.Context, dryRun bool, par
}
}

scriptWithValuesReplaced, err := magic_string_helper.ReplaceRuntimeValueInString(serializedScriptOutput, executor.runtimeValueStore)
if err != nil {
propagatedErr := stacktrace.Propagate(err, "An error occurred while replacing the runtime values in the output of the script")
serializedError := binding_constructors.NewStarlarkExecutionError(propagatedErr.Error())
starlarkRunResponseLineStream <- binding_constructors.NewStarlarkRunResponseLineFromExecutionError(serializedError)
starlarkRunResponseLineStream <- binding_constructors.NewStarlarkRunResponseLineFromRunFailureEvent()
return
if !dryRun {
Peeeekay marked this conversation as resolved.
Show resolved Hide resolved
scriptWithValuesReplaced, err := magic_string_helper.ReplaceRuntimeValueInString(serializedScriptOutput, executor.runtimeValueStore)
if err != nil {
propagatedErr := stacktrace.Propagate(err, "An error occurred while replacing the runtime values in the output of the script")
serializedError := binding_constructors.NewStarlarkExecutionError(propagatedErr.Error())
starlarkRunResponseLineStream <- binding_constructors.NewStarlarkRunResponseLineFromExecutionError(serializedError)
starlarkRunResponseLineStream <- binding_constructors.NewStarlarkRunResponseLineFromRunFailureEvent()
return
}
starlarkRunResponseLineStream <- binding_constructors.NewStarlarkRunResponseLineFromRunSuccessEvent(scriptWithValuesReplaced)
}
starlarkRunResponseLineStream <- binding_constructors.NewStarlarkRunResponseLineFromRunSuccessEvent(scriptWithValuesReplaced)
}()
return starlarkRunResponseLineStream
}