mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 18:28:12 +00:00
final reviews
This commit is contained in:
@@ -141,6 +141,13 @@ export const OCIVaultSyncFns = {
|
|||||||
// Create secrets
|
// Create secrets
|
||||||
for await (const entry of Object.entries(secretMap)) {
|
for await (const entry of Object.entries(secretMap)) {
|
||||||
const [key, { value }] = entry;
|
const [key, { value }] = entry;
|
||||||
|
|
||||||
|
// skip secrets that don't have a value set
|
||||||
|
if (!value) {
|
||||||
|
// eslint-disable-next-line no-continue
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const existingVariable = Object.values(variables).find((v) => v.secretName === key);
|
const existingVariable = Object.values(variables).find((v) => v.secretName === key);
|
||||||
|
|
||||||
if (!existingVariable) {
|
if (!existingVariable) {
|
||||||
@@ -207,7 +214,7 @@ export const OCIVaultSyncFns = {
|
|||||||
// Only update / delete active secrets
|
// Only update / delete active secrets
|
||||||
if (variable.lifecycleState === vault.models.SecretSummary.LifecycleState.Active) {
|
if (variable.lifecycleState === vault.models.SecretSummary.LifecycleState.Active) {
|
||||||
if (key in secretMap) {
|
if (key in secretMap) {
|
||||||
if (variable.value !== secretMap[key].value) {
|
if (variable.value !== secretMap[key].value && secretMap[key].value.length > 0) {
|
||||||
try {
|
try {
|
||||||
await updateOCIVaultVariable({
|
await updateOCIVaultVariable({
|
||||||
compartmentId: compartmentOcid,
|
compartmentId: compartmentOcid,
|
||||||
@@ -223,7 +230,7 @@ export const OCIVaultSyncFns = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!secretSync.syncOptions.disableSecretDeletion) {
|
} else if (!secretSync.syncOptions.disableSecretDeletion || !secretMap[key].value) {
|
||||||
try {
|
try {
|
||||||
await deleteOCIVaultVariable({
|
await deleteOCIVaultVariable({
|
||||||
compartmentId: compartmentOcid,
|
compartmentId: compartmentOcid,
|
||||||
|
|||||||
Reference in New Issue
Block a user