Skip to content

Commit b44884d

Browse files
authored
fix: make highlights consistent (#6)
1 parent 8b18e84 commit b44884d

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publisher": "sysdig",
44
"displayName": "Sysdig Scanner",
55
"description": "Sysdig Scanner for Visual Studio Code",
6-
"version": "0.2.5",
6+
"version": "0.2.6",
77
"icon": "img/logo.png",
88
"repository": "https://github.com/sysdiglabs/vscode-extension",
99
"engines": {

src/runners/vmScanRunner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as fs from 'fs';
44
import { Report } from '../types';
55
import { outputChannel, vulnTreeDataProvider, policyTreeDataProvider } from '../extension';
66
import { checkInternetConnectivity } from '../utils/connectivity';
7-
import { highlightImage } from '../fileScanners';
7+
import { clearDecorations, highlightImage } from '../fileScanners';
88
import { Z_VERSION_ERROR } from 'zlib';
99

1010
const VM_SCAN_FILE = 'vm_scan.json';
@@ -167,6 +167,7 @@ function updateVulnerabilities(statusBar: vscode.StatusBarItem, report: Report,
167167
vulnTreeDataProvider.updateVulnTree(report.result.packages, report.info.resultUrl, report.result.layers, source, range);
168168
policyTreeDataProvider.addPolicies(report.result.policyEvaluations || []);
169169
if (source) {
170+
clearDecorations(source);
170171
highlightImage(report, "", source, range);
171172
}
172173
}

src/utils/yaml.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ function traverseNode(node: yaml_ast.YAMLNode, path: string[], imageInfos: Image
2222
for (const mapping of map.mappings) {
2323
const keyNode = mapping.key;
2424
const valueNode = mapping.value;
25+
26+
if (!keyNode || !valueNode) {
27+
continue;
28+
}
29+
2530
if (keyNode.value === 'image' && valueNode.kind === yaml_ast.Kind.SCALAR) {
2631
const imageInfo: ImageInfo = {
2732
image: valueNode.value,

0 commit comments

Comments
 (0)