Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable specifying AksClusterName for new deployments #818

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading