Skip to content

Commit c7822ed

Browse files
committed
Show name/version for CRD when displayName is missing
This PR fixes #2230. Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent 73662f4 commit c7822ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/k8s/csv.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ class CsvNode implements ClusterExplorerV1.Node, ClusterExplorerV1.ClusterExplor
2121
}
2222

2323
getTreeItem(): TreeItem {
24+
const displayName = this.crdDescription.displayName? this.crdDescription.displayName : '';
25+
const nameVersion = `${this.crdDescription.name}/${this.crdDescription.version}`;
26+
const label = displayName ? `${displayName} (${nameVersion})` : nameVersion;
2427
return {
25-
label: this.crdDescription.displayName,
26-
contextValue: 'openshift.resource.csv.crdDescription'
28+
label,
29+
contextValue: 'openshift.resource.csv.crdDescription',
30+
tooltip: `Name: ${this.crdDescription.name}\nVersion: ${this.crdDescription.version}\nKind: ${this.crdDescription.kind}\nDescription: ${this.crdDescription.description || 'N/A'}`
2731
}
2832
}
2933
}

0 commit comments

Comments
 (0)