Skip to content

Commit

Permalink
Removes extra 'config' node in the infra options
Browse files Browse the repository at this point in the history
  • Loading branch information
wbreza committed Sep 18, 2024
1 parent e90ff28 commit 7d3550d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 4 additions & 2 deletions cli/azd/pkg/azapi/stack_deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
var FeatureDeploymentStacks = alpha.MustFeatureKey("deployment.stacks")

const (
deploymentStacksConfigKey = "deploymentStacks"
deploymentStacksConfigKey = "DeploymentStacks"
stacksPortalUrlFragment = "#@microsoft.onmicrosoft.com/resource"
)

Expand All @@ -40,7 +40,9 @@ var defaultDeploymentStackOptions = &deploymentStackOptions{
ResourceGroups: to.Ptr(armdeploymentstacks.DeploymentStacksDeleteDetachEnumDelete),
Resources: to.Ptr(armdeploymentstacks.DeploymentStacksDeleteDetachEnumDelete),
},
DenySettings: nil,
DenySettings: &armdeploymentstacks.DenySettings{
Mode: to.Ptr(armdeploymentstacks.DenySettingsModeNone),
},
}

type StackDeployments struct {
Expand Down
15 changes: 13 additions & 2 deletions cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,13 +604,19 @@ func (p *BicepProvider) Deploy(ctx context.Context) (*provisioning.DeployResult,
if parametersHashErr == nil {
deploymentTags[azure.TagKeyAzdDeploymentStateParamHashName] = to.Ptr(currentParamsHash)
}

optionsMap, err := convert.ToMap(p.options)
if err != nil {
return nil, err
}

deployResult, err := p.deployModule(
ctx,
bicepDeploymentData.Target,
bicepDeploymentData.CompiledBicep.RawArmTemplate,
bicepDeploymentData.CompiledBicep.Parameters,
deploymentTags,
p.options.Config,
optionsMap,
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1038,7 +1044,12 @@ func (p *BicepProvider) destroyDeploymentWithConfirmation(
p.console.StopSpinner(ctx, progressMessage.Message, input.StepFailed)
}
}, func(progress *async.Progress[azapi.DeleteDeploymentProgress]) error {
return deployment.Delete(ctx, p.options.Config, progress)
optionsMap, err := convert.ToMap(p.options)
if err != nil {
return err
}

return deployment.Delete(ctx, optionsMap, progress)
})

if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions cli/azd/pkg/infra/provisioning/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const (
)

type Options struct {
Provider ProviderKind `yaml:"provider,omitempty"`
Path string `yaml:"path,omitempty"`
Module string `yaml:"module,omitempty"`
Config map[string]any `yaml:"config,omitempty"`
Provider ProviderKind `yaml:"provider,omitempty"`
Path string `yaml:"path,omitempty"`
Module string `yaml:"module,omitempty"`
DeploymentStacks map[string]any `yaml:"deploymentStacks,omitempty"`
// Not expected to be defined at azure.yaml
IgnoreDeploymentState bool `yaml:"-"`
}
Expand Down

0 comments on commit 7d3550d

Please sign in to comment.