feat(docker secret): docker secret.json can now also be named [anything].secret.json
This commit is contained in:
parent
31bf1b27a4
commit
f5275adfbd
@ -106,12 +106,16 @@ export class Qenv {
|
|||||||
// docker secret.json
|
// docker secret.json
|
||||||
if (
|
if (
|
||||||
plugins.smartfile.fs.isDirectory('/run') &&
|
plugins.smartfile.fs.isDirectory('/run') &&
|
||||||
plugins.smartfile.fs.isDirectory('/run/secrets') &&
|
plugins.smartfile.fs.isDirectory('/run/secrets')
|
||||||
plugins.smartfile.fs.fileExistsSync(`/run/secrets/secret.json`)
|
|
||||||
) {
|
) {
|
||||||
|
const availableSecrets = plugins.smartfile.fs.listAllItemsSync('/run/secrets');
|
||||||
|
for (const secret of availableSecrets) {
|
||||||
|
if (secret.includes('secret.json') && !dockerSecret) {
|
||||||
const secretObject = plugins.smartfile.fs.toObjectSync('/run/secrets/secret.json');
|
const secretObject = plugins.smartfile.fs.toObjectSync('/run/secrets/secret.json');
|
||||||
dockerSecret = secretObject[requiredEnvVar];
|
dockerSecret = secretObject[requiredEnvVar];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// warn if there is more than one candidate
|
// warn if there is more than one candidate
|
||||||
let candidatesCounter = 0;
|
let candidatesCounter = 0;
|
||||||
@ -189,5 +193,5 @@ export class Qenv {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return missingEnvVars;
|
return missingEnvVars;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user