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

[4.1.x] Add validation for empty configs value for params file #1051

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion import-export-cli/impl/importAPI.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func envParamsFileProcess(importPath, paramsPath, importEnvironment string) erro
}

// envParamsDirectoryProcess function is used to process the environment parameters when they are provided as a
//directory
// directory
func envParamsDirectoryProcess(importPath, paramsPath, importEnvironment string) error {
apiParams, err := params.LoadApiParamsFromDirectory(paramsPath)
if err != nil {
Expand Down Expand Up @@ -362,6 +362,10 @@ func handleCustomizedParameters(importPath, paramsPath, importEnvironment string
// Process env params and create the intermediate_params.yaml file to pass to the server
func handleEnvParams(tempDirectory string, destDirectory string, environmentParams *params.Environment) error {
// read api params from external parameters file
if len(environmentParams.Config) == 0 {
return errors.New("configs value is empty in the provided parameters")
}

envParamsJson, err := jsoniter.Marshal(environmentParams.Config)
if err != nil {
return err
Expand Down