mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-23 02:21:22 +01:00
Refactor
This commit is contained in:
parent
213d6c4f7f
commit
82525cd140
3 changed files with 6 additions and 13 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
15
src/index.ts
15
src/index.ts
|
@ -346,16 +346,6 @@ async function isPodmanLocalImageLatest(): Promise<boolean> {
|
|||
return podmanImageTime > dockerImageTime;
|
||||
}
|
||||
|
||||
// remove the pulled image from the Podman image storage
|
||||
async function removeDockerImage(): Promise<void> {
|
||||
core.info(`Removing "${sourceImages[0]}" from the Podman image storage`);
|
||||
await execute(
|
||||
await getPodmanPath(),
|
||||
[ ...dockerPodmanOpts, "system", "reset", "-f" ],
|
||||
{ ignoreReturnCode: true, failOnStdErr: false, group: true }
|
||||
);
|
||||
}
|
||||
|
||||
async function createDockerPodmanImageStroage(): Promise<void> {
|
||||
core.info(`Creating temporary Podman image storage for pulling from Docker daemon`);
|
||||
dockerPodmanRoot = await fs.promises.mkdtemp(path.join(os.tmpdir(), "podman-from-docker-"));
|
||||
|
@ -382,8 +372,11 @@ async function createDockerPodmanImageStroage(): Promise<void> {
|
|||
async function removeDockerPodmanImageStroage(): Promise<void> {
|
||||
if (dockerPodmanRoot) {
|
||||
try {
|
||||
await removeDockerImage();
|
||||
core.info(`Removing temporary Podman image storage for pulling from Docker daemon`);
|
||||
await execute(
|
||||
await getPodmanPath(),
|
||||
[ ...dockerPodmanOpts, "system", "reset", "-f" ]
|
||||
);
|
||||
await fs.promises.rmdir(dockerPodmanRoot, { recursive: true });
|
||||
}
|
||||
catch (err) {
|
||||
|
|
Loading…
Add table
Reference in a new issue