Skip to content

Commit

Permalink
conditional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrat2005 committed Oct 16, 2024
1 parent 21acf37 commit ec22527
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions avm/res/azure-stack-hci/cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ module deploymentSetting 'deployment-settings/main.bicep' = [
streamingDataClient: streamingDataClient
subnetMask: subnetMask
}
dependsOn: (deploymentOperation == 'Deploy' && contains(sortedDeploymentOperations, 'Validate'))
? ['deploymentSettings-Validate']
: []
}
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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']
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit ec22527

Please sign in to comment.