diff --git a/core/src/plugins/kubernetes/container/build/common.ts b/core/src/plugins/kubernetes/container/build/common.ts index 57e41f7ead..4e9426edad 100644 --- a/core/src/plugins/kubernetes/container/build/common.ts +++ b/core/src/plugins/kubernetes/container/build/common.ts @@ -243,7 +243,7 @@ export function skopeoManifestUnknown(errMsg: string | null | undefined): boolea if (!errMsg) { return false } - return errMsg.includes("manifest unknown") || /artifact [^ ]+ not found/.test(errMsg) + return errMsg.includes("manifest unknown") || /(artifact|repository) [^ ]+ not found/.test(errMsg) } /** diff --git a/core/test/unit/src/plugins/kubernetes/container/build/common.ts b/core/test/unit/src/plugins/kubernetes/container/build/common.ts index 45b1316f6f..c0e3e6a5a1 100644 --- a/core/test/unit/src/plugins/kubernetes/container/build/common.ts +++ b/core/test/unit/src/plugins/kubernetes/container/build/common.ts @@ -30,6 +30,13 @@ describe("common build", () => { expect(skopeoManifestUnknown(errorMessage)).to.be.true }) + it("should result in manifest unknown for Harbor registry repository not found", () => { + const errorMessage = + 'Unable to query registry for image status: time="2021-10-13T17:50:25Z" level=fatal msg="Error parsing image name "docker://registry.domain/namespace/image-name:v-1f160eadbb": Error reading manifest v-1f160eadbb in registry.domain/namespace/image-name: unknown: repository namespace/image-name not found"' + + expect(skopeoManifestUnknown(errorMessage)).to.be.true + }) + it("should result in manifest not unknown for other errors", () => { const errorMessage = "unauthorized: unauthorized to access repository: namespace/image-name, action: push: unauthorized to access repository: namespace/image-name, action: push"