Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.13 cherry-pick: feat(plugins): set the manifest to unknown if repository is not found #4236

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/plugins/kubernetes/container/build/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down