Skip to content

Commit

Permalink
Fix: removing configuration from sub_environment_configuration (#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber authored Jun 15, 2024
1 parent a98efd7 commit 04b3395
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion env0/resource_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ func deploy(d *schema.ResourceData, apiClient client.ApiClientInterface) diag.Di
for i, subEnvironment := range subEnvironments {
configuration := d.Get(fmt.Sprintf("sub_environment_configuration.%d.configuration", i)).([]interface{})
configurationChanges := getConfigurationVariablesFromSchema(configuration)
configurationChanges = getUpdateConfigurationVariables(configurationChanges, subEnvironment.Id, client.ScopeWorkflow, apiClient)
configurationChanges = getUpdateConfigurationVariables(configurationChanges, subEnvironment.Id, client.ScopeEnvironment, apiClient)

for i := range configurationChanges {
configurationChanges[i].Scope = client.ScopeEnvironment
Expand Down
2 changes: 1 addition & 1 deletion env0/resource_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,7 @@ func TestUnitEnvironmentWithSubEnvironment(t *testing.T) {
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeWorkflow, environment.Id).Times(1).Return(client.ConfigurationChanges{configurationVariable}, nil),
mock.EXPECT().Environment(environment.Id).Times(1).Return(environment, nil),
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeWorkflow, environment.Id).Times(1).Return(client.ConfigurationChanges{configurationVariable}, nil),
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeWorkflow, subEnvrionmentWithId.Id).Times(1).Return(subEnvironment.Configuration, nil),
mock.EXPECT().ConfigurationVariablesByScope(client.ScopeEnvironment, subEnvrionmentWithId.Id).Times(1).Return(subEnvironment.Configuration, nil),
mock.EXPECT().EnvironmentDeploy(environment.Id, deployRequest).Times(1).Return(client.EnvironmentDeployResponse{
Id: environment.Id,
}, nil),
Expand Down

0 comments on commit 04b3395

Please sign in to comment.