diff --git a/src/deploy-cromwell-on-azure/Configuration.cs b/src/deploy-cromwell-on-azure/Configuration.cs index c4d9c3f9..87b01d6a 100644 --- a/src/deploy-cromwell-on-azure/Configuration.cs +++ b/src/deploy-cromwell-on-azure/Configuration.cs @@ -97,6 +97,7 @@ public abstract class UserAccessibleConfiguration public string DeploymentEnvironment { get; set; } public string PrivateTestUbuntuImage { get; set; } = "mcr.microsoft.com/mirror/docker/library/ubuntu:22.04"; public string PrivatePSQLUbuntuImage { get; set; } = "mcr.microsoft.com/mirror/docker/library/ubuntu:24.04"; // mcr's docker mirror does not host "latest" + public bool? CreateMissing { get; set; } = null; public static Configuration BuildConfiguration(string[] args) { diff --git a/src/deploy-cromwell-on-azure/Deployer.cs b/src/deploy-cromwell-on-azure/Deployer.cs index 48d81f26..a13f3250 100644 --- a/src/deploy-cromwell-on-azure/Deployer.cs +++ b/src/deploy-cromwell-on-azure/Deployer.cs @@ -821,7 +821,7 @@ private async Task ValidateAndGetExistin } return (await GetExistingAKSClusterAsync(configuration.AksClusterName)) - ?? throw new ValidationException($"If AKS cluster name is provided, the cluster must already exist in region {configuration.RegionName}, and be accessible to the current user.", displayExample: false); + ?? (configuration.CreateMissing.GetValueOrDefault() ? null : throw new ValidationException($"If AKS cluster name is provided, the cluster must already exist in region {configuration.RegionName}, and be accessible to the current user. Set {nameof(configuration.CreateMissing)} to true to create cluster with provided name.", displayExample: false)); } private async Task GetExistingPostgresqlService(string serverName) @@ -2236,8 +2236,12 @@ void ValidateHelmInstall(string helmPath, string featureName) ThrowIfNotProvidedForUpdate(configuration.ResourceGroupName, nameof(configuration.ResourceGroupName)); - ThrowIfProvidedForInstall(configuration.AksClusterName, nameof(configuration.AksClusterName)); + if (!configuration.CreateMissing.GetValueOrDefault()) + { + ThrowIfProvidedForInstall(configuration.AksClusterName, nameof(configuration.AksClusterName)); + } + ThrowIfProvidedForUpdate(configuration.CreateMissing, nameof(configuration.CreateMissing)); ThrowIfProvidedForUpdate(configuration.BatchPrefix, nameof(configuration.BatchPrefix)); ThrowIfProvidedForUpdate(configuration.RegionName, nameof(configuration.RegionName)); ThrowIfProvidedForUpdate(configuration.BatchAccountName, nameof(configuration.BatchAccountName));