another take on prune images
This commit is contained in:
+2
-1
@@ -62,7 +62,8 @@ async function pruneInfraImages() {
|
|||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
if (!line) continue;
|
if (!line) continue;
|
||||||
const [, repo, tag, digest] = line.split(' '); // [ ID, Repo, Tag, Digest ]
|
const [, repo, tag, digest] = line.split(' '); // [ ID, Repo, Tag, Digest ]
|
||||||
if (!parsedTag.repository.endsWith(repo)) continue; // some other repo
|
const normalizedRepo = repo.replace('registry.ipv6.docker.com/', '').replace('registry-1.docker.io/', '').replace('registry.docker.com/', '');
|
||||||
|
if (!parsedTag.repository.endsWith(normalizedRepo)) continue; // some other repo
|
||||||
if (imageName === `${repo}:${tag}@${digest}`) continue; // the image we want to keep
|
if (imageName === `${repo}:${tag}@${digest}`) continue; // the image we want to keep
|
||||||
|
|
||||||
const imageIdToPrune = tag === '<none>' ? `${repo}@${digest}` : `${repo}:${tag}`; // untagged, use digest
|
const imageIdToPrune = tag === '<none>' ? `${repo}@${digest}` : `${repo}:${tag}`; // untagged, use digest
|
||||||
|
|||||||
Reference in New Issue
Block a user