-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(k8s): harbor registry support (#2619)
* fix: support newest Harbor registry error text * test: add test for skopeo manifest unknown error
- Loading branch information
1 parent
2ba8f6d
commit edd5e3f
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
core/test/unit/src/plugins/kubernetes/container/build/common.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) 2018-2021 Garden Technologies, Inc. <[email protected]> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import { skopeoManifestUnknown } from "../../../../../../../src/plugins/kubernetes/container/build/common" | ||
import { expect } from "chai" | ||
|
||
describe("common build", () => { | ||
describe("manifest error", () => { | ||
it("should result in manifest unknown for common registry error", () => { | ||
const errorMessage = "ERROR: manifest unknown: manifest unknown" | ||
|
||
expect(skopeoManifestUnknown(errorMessage)).to.be.true | ||
}) | ||
|
||
it("should result in manifest unknown for Harbor registry error", () => { | ||
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: artifact namespace/image-name:v-1f160eadbb 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" | ||
|
||
expect(skopeoManifestUnknown(errorMessage)).to.be.false | ||
}) | ||
}) | ||
}) |