Skip to content

Commit

Permalink
fix: Don't return empty labels for oci-archive
Browse files Browse the repository at this point in the history
Don't return empty labels for oci-archive extraction. This means
imageLabels fact won't be present for oci-archive images. Consequently,
client can assume we don't have label information for this image...
instead of assuming the image itself has no labels.
  • Loading branch information
hisenb3rg committed Feb 10, 2021
1 parent a284081 commit 1230b1a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion lib/extractor/index.ts
Expand Up @@ -31,7 +31,6 @@ export async function extractImageContent(
imageId: ociExtractor.getImageIdFromManifest(ociArchive.manifest),
manifestLayers: ociExtractor.getManifestLayers(ociArchive.manifest),
extractedLayers: layersWithLatestFileModifications(ociArchive.layers),
imageLabels: {},
};
default:
const dockerArchive = await dockerExtractor.extractArchive(
Expand Down
2 changes: 1 addition & 1 deletion lib/extractor/types.ts
Expand Up @@ -18,7 +18,7 @@ export interface ExtractionResult {
rootFsLayers?: string[];
autoDetectedUserInstructions?: DockerFileAnalysis;
platform?: string;
imageLabels: { [key: string]: string };
imageLabels?: { [key: string]: string };
}

export interface ExtractedLayers {
Expand Down
Expand Up @@ -390,10 +390,6 @@ Object {
],
"type": "imageLayers",
},
Object {
"data": Object {},
"type": "imageLabels",
},
Object {
"data": "Alpine Linux v3.12",
"type": "imageOsReleasePrettyName",
Expand Down
4 changes: 0 additions & 4 deletions test/system/image-type/__snapshots__/oci-archive.spec.ts.snap
Expand Up @@ -368,10 +368,6 @@ Object {
],
"type": "imageLayers",
},
Object {
"data": Object {},
"type": "imageLabels",
},
Object {
"data": "Alpine Linux v3.12",
"type": "imageOsReleasePrettyName",
Expand Down

0 comments on commit 1230b1a

Please sign in to comment.