@@ -231,6 +231,7 @@ await ExecHelmProcessAsync($"upgrade --install tesonazure ./helm --kubeconfig \"
231
231
workingDirectory : workingDirectoryTemp ) ;
232
232
await WaitForWorkloadAsync ( kubernetesClient , "tes" , configuration . AksCoANamespace , cancellationToken ) ;
233
233
}
234
+
234
235
public async Task RemovePodAadChart ( )
235
236
{
236
237
await ExecHelmProcessAsync ( $ "uninstall aad-pod-identity", throwOnNonZeroExitCode : false ) ;
@@ -300,6 +301,27 @@ public async Task UpgradeValuesYamlAsync(IStorageAccount storageAccount, Diction
300
301
await Deployer . UploadTextToStorageAccountAsync ( storageAccount , Deployer . ConfigurationContainerName , "aksValues.yaml" , valuesString , cancellationToken ) ;
301
302
}
302
303
304
+ public async Task < FileInfo > ConfigureAltLocalValuesYamlAsync ( string altName , Action < HelmValues > configure )
305
+ {
306
+ FileInfo altValues = new ( Path . Combine ( Path . GetDirectoryName ( TempHelmValuesYamlPath ) , altName ) ) ;
307
+ var values = KubernetesYaml . Deserialize < HelmValues > ( await File . ReadAllTextAsync ( TempHelmValuesYamlPath , cancellationToken ) ) ;
308
+ configure ( values ) ;
309
+ await File . WriteAllTextAsync ( altValues . FullName , KubernetesYaml . Serialize ( values ) , cancellationToken ) ;
310
+ return altValues ;
311
+ }
312
+
313
+ public FileInfo SwapLocalValuesYaml ( FileInfo file )
314
+ {
315
+ FileInfo backup = new ( Path . Combine ( file . DirectoryName , "backup.bak" ) ) ;
316
+ File . Replace ( file . FullName , TempHelmValuesYamlPath , backup . FullName ) ;
317
+ return backup ;
318
+ }
319
+
320
+ public void RestoreLocalValuesYaml ( FileInfo backup )
321
+ {
322
+ File . Replace ( backup . FullName , TempHelmValuesYamlPath , default ) ;
323
+ }
324
+
303
325
public async Task < Dictionary < string , string > > GetAKSSettingsAsync ( IStorageAccount storageAccount )
304
326
{
305
327
var values = KubernetesYaml . Deserialize < HelmValues > ( await Deployer . DownloadTextFromStorageAccountAsync ( storageAccount , Deployer . ConfigurationContainerName , "aksValues.yaml" , cancellationToken ) ) ;
0 commit comments