Skip to content

Commit

Permalink
fix: secrets being deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Feb 7, 2025
1 parent 8ce1315 commit bae3cfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,12 @@ export const azureAppConfigurationSecretSyncFactory = ({

for await (const key of Object.keys(azureAppConfigSecrets)) {
const azureSecret = azureAppConfigSecrets[key];
if (!(key in secretMap) || secretMap[key] === null || azureSecret.label !== secretSync.destinationConfig.label) {
await $deleteAzureSecret(
accessToken,
secretSync.destinationConfig.configurationUrl,
key,
azureSecret.label // use the secret's actual label for deletion
);
if (
!(key in secretMap) ||
secretMap[key] === null ||
(azureSecret.label && azureSecret.label !== secretSync.destinationConfig.label)
) {
await $deleteAzureSecret(accessToken, secretSync.destinationConfig.configurationUrl, key, azureSecret.label);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ export const azureKeyVaultSecretSyncFactory = ({

Object.keys(vaultSecrets).forEach((key) => {
if (!disabledAzureKeyVaultSecretKeys.includes(key)) {
secretMap[key] = {
const underscoredKey = key.replace(/-/g, "_");
secretMap[underscoredKey] = {
value: vaultSecrets[key].value
};
}
Expand Down

0 comments on commit bae3cfb

Please sign in to comment.