From ec225278d263dbe69df34209985ae3c08d19c9fd Mon Sep 17 00:00:00 2001 From: Matthew Bratschun Date: Wed, 16 Oct 2024 10:10:14 -0600 Subject: [PATCH] conditional dependency --- avm/res/azure-stack-hci/cluster/main.bicep | 3 +++ .../tests/e2e/2nodeswitched.defaults/main.test.bicep | 6 +++--- .../tests/e2e/3nodeswitchless.defaults/main.test.bicep | 6 +++--- .../cluster/tests/e2e/waf-aligned/main.test.bicep | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/avm/res/azure-stack-hci/cluster/main.bicep b/avm/res/azure-stack-hci/cluster/main.bicep index ce4e66c0bf..6b6860bc27 100644 --- a/avm/res/azure-stack-hci/cluster/main.bicep +++ b/avm/res/azure-stack-hci/cluster/main.bicep @@ -223,6 +223,9 @@ module deploymentSetting 'deployment-settings/main.bicep' = [ streamingDataClient: streamingDataClient subnetMask: subnetMask } + dependsOn: (deploymentOperation == 'Deploy' && contains(sortedDeploymentOperations, 'Validate')) + ? ['deploymentSettings-Validate'] + : [] } ] diff --git a/avm/res/azure-stack-hci/cluster/tests/e2e/2nodeswitched.defaults/main.test.bicep b/avm/res/azure-stack-hci/cluster/tests/e2e/2nodeswitched.defaults/main.test.bicep index 7580c92b29..eaf21dc3d9 100644 --- a/avm/res/azure-stack-hci/cluster/tests/e2e/2nodeswitched.defaults/main.test.bicep +++ b/avm/res/azure-stack-hci/cluster/tests/e2e/2nodeswitched.defaults/main.test.bicep @@ -79,9 +79,6 @@ module hciDependencies 'dependencies.bicep' = { module testDeployment '../../../main.bicep' = [ for deploymentOperation in deploymentOperations: { - dependsOn: [ - hciDependencies - ] name: '${uniqueString(deployment().name, enforcedLocation)}-test-cluster${deploymentOperation}-${serviceShort}' scope: resourceGroup params: { @@ -104,5 +101,8 @@ module testDeployment '../../../main.bicep' = [ storageNetworks: hciDependencies.outputs.storageNetworks subnetMask: hciDependencies.outputs.subnetMask } + dependsOn: (deploymentOperation == 'Deploy' && contains(deploymentOperations, 'Validate')) + ? ['deploymentSettings-Validate', 'hciDependencies'] + : ['hciDependencies'] } ] diff --git a/avm/res/azure-stack-hci/cluster/tests/e2e/3nodeswitchless.defaults/main.test.bicep b/avm/res/azure-stack-hci/cluster/tests/e2e/3nodeswitchless.defaults/main.test.bicep index 4249c52219..b06f57f032 100644 --- a/avm/res/azure-stack-hci/cluster/tests/e2e/3nodeswitchless.defaults/main.test.bicep +++ b/avm/res/azure-stack-hci/cluster/tests/e2e/3nodeswitchless.defaults/main.test.bicep @@ -79,9 +79,9 @@ module hciDependencies 'dependencies.bicep' = { module testDeployment '../../../main.bicep' = [ for deploymentOperation in deploymentOperations: { - dependsOn: [ - hciDependencies - ] + dependsOn: (deploymentOperation == 'Deploy' && contains(deploymentOperations, 'Validate')) + ? ['deploymentSettings-Validate', 'hciDependencies'] + : ['hciDependencies'] name: '${uniqueString(deployment().name, enforcedLocation)}-test-cluster${deploymentOperation}-${serviceShort}' scope: resourceGroup params: { diff --git a/avm/res/azure-stack-hci/cluster/tests/e2e/waf-aligned/main.test.bicep b/avm/res/azure-stack-hci/cluster/tests/e2e/waf-aligned/main.test.bicep index a368b9d680..8b0e1fdd41 100644 --- a/avm/res/azure-stack-hci/cluster/tests/e2e/waf-aligned/main.test.bicep +++ b/avm/res/azure-stack-hci/cluster/tests/e2e/waf-aligned/main.test.bicep @@ -79,9 +79,9 @@ module hciDependencies 'dependencies.bicep' = { module testDeployment '../../../main.bicep' = [ for deploymentOperation in deploymentOperations: { - dependsOn: [ - hciDependencies - ] + dependsOn: (deploymentOperation == 'Deploy' && contains(deploymentOperations, 'Validate')) + ? ['deploymentSettings-Validate', 'hciDependencies'] + : ['hciDependencies'] name: '${uniqueString(deployment().name, enforcedLocation)}-test-cluster${deploymentOperation}-${serviceShort}' scope: resourceGroup params: {