Skip to content

Commit

Permalink
Enable specifying AksClusterName for new deployments (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
BMurri authored Sep 30, 2024
1 parent 7f1ac52 commit 8542a71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/deploy-cromwell-on-azure/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 6 additions & 2 deletions src/deploy-cromwell-on-azure/Deployer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ private async Task<ContainerServiceManagedClusterResource> 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<PostgreSqlFlexibleServerResource> GetExistingPostgresqlService(string serverName)
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 8542a71

Please sign in to comment.