Skip to content
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
1 change: 1 addition & 0 deletions api-service/controller/env_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (ctrl *EnvInstanceController) CreateEnvInstance(c *gin.Context) {
}
secondImageName := imagePrefix + ":" + req.Datasource
backendEnv.DeployConfig["secondImageName"] = secondImageName
backendEnv.DeployConfig["dataSource"] = req.Datasource
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The key "dataSource" is inconsistent with other keys in DeployConfig that appear to follow the JSON tag naming convention from the request struct (e.g., "environment_variables"). The JSON tag for this field is "datasource". Using "datasource" as the key would improve consistency and prevent potential bugs.

Additionally, for better maintainability, consider defining constants for all DeployConfig keys to avoid using magic strings.

Suggested change
backendEnv.DeployConfig["dataSource"] = req.Datasource
backendEnv.DeployConfig["datasource"] = req.Datasource

}
if req.EnvironmentVariables != nil {
backendEnv.DeployConfig["environment_variables"] = req.EnvironmentVariables
Expand Down
Loading