mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-22 18:21:20 +01:00
fix issue with property field name
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
parent
e5afab8b69
commit
c977b29e3f
3 changed files with 6 additions and 4 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -19,9 +19,11 @@ export async function run(): Promise<void> {
|
|||
return Promise.reject(new Error(checkImages.reason));
|
||||
}
|
||||
const parsedCheckImages = JSON.parse(checkImages.output);
|
||||
// this is to temporarily solve an issue with the case-sensitive of the property field name. i.e it is Names or names??
|
||||
const nameKeyMixedCase = parsedCheckImages[0] && Object.keys(parsedCheckImages[0]).find(key => 'names' === key.toLowerCase());
|
||||
const imagesFound = parsedCheckImages.
|
||||
filter(image => image.names && image.names.find(name => name.includes(`${imageToPush}:${tag}`))).
|
||||
map(image => image.names);
|
||||
filter(image => image[nameKeyMixedCase] && image[nameKeyMixedCase].find(name => name.includes(`${imageToPush}:${tag}`))).
|
||||
map(image => image[nameKeyMixedCase]);
|
||||
if (imagesFound.length === 0) {
|
||||
//check inside the docker daemon local storage
|
||||
const pullFromDocker: CommandResult = await execute(podman, ['pull', `docker-daemon:${imageToPush}:${tag}`]);
|
||||
|
|
Loading…
Add table
Reference in a new issue