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

fix: harbor error support #2619

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Changes from 1 commit
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
Next Next commit
fix: support newest Harbor registry error text
mattpolzin committed Oct 14, 2021

Verified

This commit was signed with the committer’s verified signature.
danudey Daniel Fox
commit 4e21776d97e52525e1cc321776a5d1fb1bddca30
9 changes: 8 additions & 1 deletion core/src/plugins/kubernetes/container/build/common.ts
Original file line number Diff line number Diff line change
@@ -256,7 +256,7 @@ export async function skopeoBuildStatus({
const res = err.detail?.result || {}

// Non-zero exit code can both mean the manifest is not found, and any other unexpected error
if (res.exitCode !== 0 && !res.stderr?.includes("manifest unknown")) {
if (res.exitCode !== 0 && !skopeoManifestUnknown(res.stderr)) {
const output = res.allLogs || err.message

throw new RuntimeError(`Unable to query registry for image status: ${output}`, {
@@ -268,6 +268,13 @@ export async function skopeoBuildStatus({
}
}

export function skopeoManifestUnknown(errMsg: string | null | undefined) : boolean {
if (!errMsg) {
return false
}
return errMsg.includes("manifest unknown") || /artifact [^ ]+ not found/.test(errMsg)
}

/**
* Get a PodRunner for the util deployment in the garden-system namespace.
*/