Skip to content

Commit

Permalink
Ensure removal of cromwell-executions-claim1
Browse files Browse the repository at this point in the history
  • Loading branch information
BMurri committed Feb 12, 2025
1 parent 480d62e commit cf274cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/deploy-cromwell-on-azure/Deployer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ await Task.WhenAll(

await kubernetesManager.UpgradeValuesYamlAsync(storageAccountData, settings, containersToMount, installedVersion);
kubernetesClient = await PerformHelmDeploymentAsync(aksCluster, manualPrecommands, asyncTask);
await kubernetesManager.ProcessClusterUpdatesAsync(kubernetesClient, installedVersion);

await WriteNonPersonalizedFilesToStorageAccountAsync(storageAccountData);
}
Expand Down
15 changes: 14 additions & 1 deletion src/deploy-cromwell-on-azure/KubernetesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ public async Task UpdateHelmValuesAsync(Azure.ResourceManager.Storage.StorageAcc

MergeContainers(containersToMount, values);

// TODO: Does this make sense? If so, do we need this in TES?
if (azureCloudConfig.ArmEnvironment != ArmEnvironment.AzurePublicCloud)
{
values.ExternalSasContainers = null;
Expand Down Expand Up @@ -270,6 +269,20 @@ private static void ProcessHelmValuesUpdates(HelmValues values, Version previous
}
}

public async Task ProcessClusterUpdatesAsync(IKubernetes kubernetes, Version previousVersion)
{
if (Deployer.IsStorageInPublicCloud && (previousVersion > new Version(5, 5, 0) && previousVersion < new Version(5, 5, 3)))
{
foreach (var volume in (await kubernetes.CoreV1.ListPersistentVolumeWithHttpMessagesAsync(cancellationToken: cancellationToken)).Body)
{
if ("coa-blob-cromwell-executions".Equals(volume.Spec.StorageClassName))
{
_ = await kubernetes.CoreV1.DeletePersistentVolumeAsync(volume.Name(), orphanDependents: true, cancellationToken: cancellationToken);
}
}
}
}

public async Task<Dictionary<string, string>> GetAKSSettingsAsync(Azure.ResourceManager.Storage.StorageAccountData storageAccount)
{
var values = KubernetesYaml.Deserialize<HelmValues>(await Deployer.DownloadTextFromStorageAccountAsync(_GetBlobClient(storageAccount, Deployer.ConfigurationContainerName, "aksValues.yaml"), cancellationToken));
Expand Down

0 comments on commit cf274cb

Please sign in to comment.