Skip to content

Commit cfe7050

Browse files
authored
fix: enable Kaniko archive (CN-942) (#776)
* fix: add separate test:unit and test:system steps * fix: update resource class to medium to fix OOM * fix: add kaniko archive case * fix: add test case to validate Kaniko extraction * fix: updated dates on ignores
1 parent f7906b7 commit cfe7050

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/scan.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ export async function extractContent(
259259
switch (imageType) {
260260
case ImageType.DockerArchive:
261261
case ImageType.OciArchive:
262+
case ImageType.KanikoArchive:
262263
imagePath = getAndValidateArchivePath(targetImage);
263264
break;
264265
case ImageType.Identifier:

test/system/image-type/kaniko-archive.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { scan } from "../../../lib";
1+
import { extractContent, scan } from "../../../lib";
22
import { getFixture } from "../../util";
33

44
describe("kaniko archive scanning", () => {
@@ -12,4 +12,13 @@ describe("kaniko archive scanning", () => {
1212

1313
expect(pluginResult).toMatchSnapshot();
1414
});
15+
16+
it("should extract content from a kaniko archive without throwing", async () => {
17+
const fixturePath = getFixture("kaniko-archives/kaniko-busybox.tar");
18+
const imageNameAndTag = `kaniko-archive:${fixturePath}`;
19+
20+
await expect(
21+
extractContent([], { path: imageNameAndTag }),
22+
).resolves.not.toThrow();
23+
});
1524
});

0 commit comments

Comments
 (0)