From 1bf4dbf3b1e7a69a01a49c3d10683cca311b015d Mon Sep 17 00:00:00 2001 From: Blair L Murri Date: Mon, 4 Nov 2024 14:51:23 -0800 Subject: [PATCH] Remove sasToken from datasettestinputs --- src/deploy-cromwell-on-azure/KubernetesManager.cs | 14 +++++++++++--- .../scripts/helm/values-template.yaml | 6 ++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/deploy-cromwell-on-azure/KubernetesManager.cs b/src/deploy-cromwell-on-azure/KubernetesManager.cs index 174f5798..886eebdc 100644 --- a/src/deploy-cromwell-on-azure/KubernetesManager.cs +++ b/src/deploy-cromwell-on-azure/KubernetesManager.cs @@ -36,8 +36,6 @@ internal class KubernetesManager .Handle(ex => ex.WebSocketErrorCode == WebSocketError.NotAWebSocket) .WaitAndRetryAsync(200, retryAttempt => TimeSpan.FromSeconds(5)); - private static readonly HashSet testStorageAccounts = new HashSet { "datasettestinputs", "datasettestinputssouthc" }; - // "master" is used despite not being a best practice: https://github.com/kubernetes-sigs/blob-csi-driver/issues/783 private const string BlobCsiDriverGithubReleaseBranch = "master"; private const string BlobCsiDriverGithubReleaseVersion = "v1.24.0"; @@ -222,11 +220,21 @@ public async Task UpgradeValuesYamlAsync(Azure.ResourceManager.Storage.StorageAc private static void ProcessHelmValuesUpdates(HelmValues values, Version previousVersion) { - if (previousVersion < new Version(4, 3)) + if (previousVersion is null || previousVersion < new Version(4, 3)) { values.CromwellContainers = [Deployer.ConfigurationContainerName, Deployer.ExecutionsContainerName, Deployer.LogsContainerName, Deployer.OutputsContainerName]; values.DefaultContainers = [Deployer.InputsContainerName]; } + + if (previousVersion is null || previousVersion < new Version(5, 5, 0)) + { + var datasettestinputs = values.ExternalSasContainers.SingleOrDefault(container => container.TryGetValue("accountName", out var name) && "datasettestinputs".Equals(name, StringComparison.OrdinalIgnoreCase)); + + if (datasettestinputs is not null) + { + _ = datasettestinputs.Remove("sasToken"); + } + } } public async Task> GetAKSSettingsAsync(Azure.ResourceManager.Storage.StorageAccountData storageAccount) diff --git a/src/deploy-cromwell-on-azure/scripts/helm/values-template.yaml b/src/deploy-cromwell-on-azure/scripts/helm/values-template.yaml index 8ff2380f..74a7daf0 100644 --- a/src/deploy-cromwell-on-azure/scripts/helm/values-template.yaml +++ b/src/deploy-cromwell-on-azure/scripts/helm/values-template.yaml @@ -101,10 +101,8 @@ externalSasContainers: #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Public example, not confidential")] sasToken: "si=coa&spr=https&sv=2022-11-02&sr=c&sig=Updk4aRmzWJai%2BhtQaLjNJAVq5jwc5M4frsCBTjIj%2FM%3D" containerName: dataset -# - accountName: datasettestinputs -##[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Public example, not confidential")] -# sasToken: "sv=2018-03-28&sr=c&si=coa&sig=nKoK6dxjtk5172JZfDH116N6p3xTs7d%2Bs5EAUE4qqgM%3D" -# containerName: dataset + - accountName: datasettestinputs + containerName: dataset # - accountName: storageAccount # sasToken: "" # containerName: test-inputs