Show containerd version/icon on nodes

This commit is contained in:
Vincent Fiduccia 2019-03-12 12:55:12 -07:00
parent 2b4cac7505
commit 20fdee61f1
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
3 changed files with 30 additions and 4 deletions

View File

@ -54,11 +54,11 @@
<td data-title="{{dt.version}}">
{{#if model.info.kubernetes.kubeletVersion}}
{{model.info.kubernetes.kubeletVersion}}
{{#if model.info.os.dockerVersion}}
{{#if model.engineBlurb}}
<div class="text-small text-muted">
<span>
<i class="icon icon-docker"></i>
{{model.info.os.dockerVersion}}
<i class="icon {{model.engineIcon}}"></i>
{{model.engineBlurb}}
</span>
</div>
{{/if}}

View File

@ -12,6 +12,8 @@ import Grafana from 'shared/mixins/grafana';
const UNSCHEDULABLE_KEYS = ['node-role.kubernetes.io/etcd', 'node-role.kubernetes.io/controlplane'];
const UNSCHEDULABLE_EFFECTS = ['NoExecute', 'NoSchedule'];
const CONTAINERD = 'containerd://';
var Node = Resource.extend(Grafana, StateCounts, ResourceUsage, {
modalService: service('modal'),
settings: service(),
@ -163,6 +165,30 @@ var Node = Resource.extend(Grafana, StateCounts, ResourceUsage, {
return out;
}),
engineIcon: computed('info.os.dockerVersion', function() {
if ( (get(this, 'info.os.dockerVersion') || '').startsWith(CONTAINERD) ) {
return 'icon-container-d';
}
return 'icon-docker';
}),
engineBlurb: computed('info.os.dockerVersion', function() {
let version = get(this, 'info.os.dockerVersion') || '';
if ( version.startsWith(CONTAINERD) ) {
version = version.substr(CONTAINERD.length);
}
const idx = version.indexOf('+');
if ( idx > 0 ) {
version = version.substr(0, idx);
}
return version;
}),
// or they will not be pulled in correctly.
displayEndpoints: function() {
var store = get(this, 'clusterStore');

2
vendor/icons vendored

@ -1 +1 @@
Subproject commit abf52b68dec075b4759ed653775e793bc464f3b4
Subproject commit dc7c438544167077ea087bd594921c0d12e7b182