From 0385a2bb6158386ed126ad74c4a74aee22f503b3 Mon Sep 17 00:00:00 2001 From: Wallace Breza Date: Thu, 19 Sep 2024 09:19:13 -0700 Subject: [PATCH] Fixes issue with nil deployment stacks configuration --- cli/azd/pkg/azapi/stack_deployments.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/azd/pkg/azapi/stack_deployments.go b/cli/azd/pkg/azapi/stack_deployments.go index 151e6b4bd45..172b2be751b 100644 --- a/cli/azd/pkg/azapi/stack_deployments.go +++ b/cli/azd/pkg/azapi/stack_deployments.go @@ -524,19 +524,19 @@ func parseDeploymentStackOptions(options map[string]any) (*deploymentStackOption var deploymentStackOptions *deploymentStackOptions has, err := optionsConfig.GetSection(deploymentStacksConfigKey, &deploymentStackOptions) - if !has { - return defaultDeploymentStackOptions, nil - } - if err != nil { suggestion := &internal.ErrorWithSuggestion{ Err: fmt.Errorf("failed parsing deployment stack options: %w", err), - Suggestion: "Review the 'infra.config.deploymentStacks' configuration section in the 'azure.yaml' file.", + Suggestion: "Review the 'infra.deploymentStacks' configuration section in the 'azure.yaml' file.", } return nil, suggestion } + if !has || deploymentStackOptions == nil { + return defaultDeploymentStackOptions, nil + } + if deploymentStackOptions.BypassStackOutOfSyncError == nil { deploymentStackOptions.BypassStackOutOfSyncError = defaultDeploymentStackOptions.BypassStackOutOfSyncError }