add imageid output and use metadata to set digest output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-03-14 19:30:50 +01:00
parent fe02965b48
commit 50fa0058d9
7 changed files with 153 additions and 87 deletions

View File

@ -34,6 +34,17 @@ export async function getMetadata(): Promise<string | undefined> {
return content;
}
export async function getDigest(metadata: string | undefined): Promise<string | undefined> {
if (metadata === undefined) {
return undefined;
}
const metadataJSON = JSON.parse(metadata);
if (metadataJSON['containerimage.digest']) {
return metadataJSON['containerimage.digest'];
}
return undefined;
}
export async function getSecretString(kvp: string): Promise<string> {
return getSecret(kvp, false);
}