Skip to content

Commit

Permalink
updating per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmimsft committed Feb 28, 2024
1 parent 3a3e7b2 commit ed988b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/recipes/terraform/config/providers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func GetRecipeProviderConfigs(ctx context.Context, envConfig *recipes.Configurat

// Retrieve configuration details from 'AdditionalProperties' property and add to the list.
for _, configDetails := range config {
configList = append(configList, configDetails.AdditionalProperties)
if configDetails.AdditionalProperties != nil && len(configDetails.AdditionalProperties) > 0 {
configList = append(configList, configDetails.AdditionalProperties)
}
}

providerConfigs[provider] = configList
Expand Down
2 changes: 1 addition & 1 deletion pkg/recipes/terraform/config/providers/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestGetRecipeProviderConfigs(t *testing.T) {
},
},
},
expected: map[string]any{"aws": []map[string]any{map[string]any(nil)}},
expected: map[string]any{"aws": []map[string]any{}},
},
{
desc: "provider with config",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
},
"provider": {
"azurerm": [
null,
{
"alias": "az-paymentservice",
"subscriptionid": 45678,
Expand Down

0 comments on commit ed988b7

Please sign in to comment.