From 0cfa912d77694ca0d3886d469a429f4506013bfc Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Fri, 12 Feb 2021 02:59:20 +0200 Subject: [PATCH] feat(kube/app): show image pull policy (#4785) * feat(kube/app): show image pull policy * fix(kube/app): remove image pull policy * feat(kube/apps): show container image pull policy --- .../containers-datatable/containersDatatable.html | 8 ++++++++ app/kubernetes/converters/application.js | 4 +++- app/kubernetes/pod/converter.js | 1 + app/kubernetes/pod/models/index.js | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/kubernetes/components/datatables/application/containers-datatable/containersDatatable.html b/app/kubernetes/components/datatables/application/containers-datatable/containersDatatable.html index 1d77ab609..e441ca663 100644 --- a/app/kubernetes/components/datatables/application/containers-datatable/containersDatatable.html +++ b/app/kubernetes/components/datatables/application/containers-datatable/containersDatatable.html @@ -78,6 +78,13 @@ + + + Image Pull Policy + + + + Status @@ -110,6 +117,7 @@ {{ item.PodName }} {{ item.Name }} {{ item.Image }} + {{ item.ImagePullPolicy }} {{ item.Status }} diff --git a/app/kubernetes/converters/application.js b/app/kubernetes/converters/application.js index a1fe39b44..3c075956b 100644 --- a/app/kubernetes/converters/application.js +++ b/app/kubernetes/converters/application.js @@ -59,7 +59,9 @@ class KubernetesApplicationConverter { res.Note = data.metadata.annotations ? data.metadata.annotations[KubernetesPortainerApplicationNote] || '' : ''; res.ApplicationName = data.metadata.labels ? data.metadata.labels[KubernetesPortainerApplicationNameLabel] || res.Name : res.Name; res.ResourcePool = data.metadata.namespace; - res.Image = containers[0].image; + if (containers.length) { + res.Image = containers[0].image; + } res.CreationDate = data.metadata.creationTimestamp; res.Env = _.without(_.flatMap(_.map(containers, 'env')), undefined); res.Pods = data.spec.selector ? KubernetesApplicationHelper.associatePodsAndApplication(pods, data.spec.selector) : [data]; diff --git a/app/kubernetes/pod/converter.js b/app/kubernetes/pod/converter.js index 127d3760a..a3b01b18c 100644 --- a/app/kubernetes/pod/converter.js +++ b/app/kubernetes/pod/converter.js @@ -70,6 +70,7 @@ function computeContainers(data) { res.PodName = data.metadata.name; res.Name = item.name; res.Image = item.image; + res.ImagePullPolicy = item.imagePullPolicy; res.Node = data.spec.nodeName; res.CreationDate = data.status.startTime; res.Status = computeContainerStatus(data.status.containerStatuses, item.name); diff --git a/app/kubernetes/pod/models/index.js b/app/kubernetes/pod/models/index.js index b00307b62..a2590610f 100644 --- a/app/kubernetes/pod/models/index.js +++ b/app/kubernetes/pod/models/index.js @@ -47,6 +47,7 @@ const _KubernetesPodContainer = Object.freeze({ PodName: '', Name: '', Image: '', + ImagePullPolicy: '', Node: '', CreationDate: '', Status: '',