fix(app): replace fields removed by Docker 25 and 26 (#11468)
* fix(app/volume): make optional Container and ContainerConfig fields removed in docker 26 * fix(app/image): use image.Size instead of image.VirtualSize removed in Docker 25pull/11480/head
parent
d336a14e50
commit
2b53bebcb3
|
@ -14,7 +14,7 @@ export function ImageViewModel(data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.VirtualSize = data.VirtualSize;
|
this.Size = data.Size;
|
||||||
this.Used = data.Used;
|
this.Used = data.Used;
|
||||||
|
|
||||||
if (data.Portainer && data.Portainer.Agent && data.Portainer.Agent.NodeName) {
|
if (data.Portainer && data.Portainer.Agent && data.Portainer.Agent.NodeName) {
|
||||||
|
|
|
@ -6,15 +6,22 @@ export function ImageDetailsViewModel(data) {
|
||||||
this.Created = data.Created;
|
this.Created = data.Created;
|
||||||
this.Checked = false;
|
this.Checked = false;
|
||||||
this.RepoTags = data.RepoTags;
|
this.RepoTags = data.RepoTags;
|
||||||
this.VirtualSize = data.VirtualSize;
|
this.Size = data.Size;
|
||||||
this.DockerVersion = data.DockerVersion;
|
this.DockerVersion = data.DockerVersion;
|
||||||
this.Os = data.Os;
|
this.Os = data.Os;
|
||||||
this.Architecture = data.Architecture;
|
this.Architecture = data.Architecture;
|
||||||
this.Author = data.Author;
|
this.Author = data.Author;
|
||||||
this.Command = data.Config.Cmd;
|
this.Command = data.Config.Cmd;
|
||||||
this.Entrypoint = data.ContainerConfig.Entrypoint ? data.ContainerConfig.Entrypoint : '';
|
|
||||||
this.ExposedPorts = data.ContainerConfig.ExposedPorts ? Object.keys(data.ContainerConfig.ExposedPorts) : [];
|
let config = {};
|
||||||
this.Volumes = data.ContainerConfig.Volumes ? Object.keys(data.ContainerConfig.Volumes) : [];
|
if (data.Config) {
|
||||||
this.Env = data.ContainerConfig.Env ? data.ContainerConfig.Env : [];
|
config = data.Config; // this is part of OCI images-spec
|
||||||
this.Labels = data.ContainerConfig.Labels;
|
} else if (data.ContainerConfig != null) {
|
||||||
|
config = data.ContainerConfig; // not OCI ; has been removed in Docker 26 (API v1.45) along with .Container
|
||||||
|
}
|
||||||
|
this.Entrypoint = config.Entrypoint ? config.Entrypoint : '';
|
||||||
|
this.ExposedPorts = config.ExposedPorts ? Object.keys(config.ExposedPorts) : [];
|
||||||
|
this.Volumes = config.Volumes ? Object.keys(config.Volumes) : [];
|
||||||
|
this.Env = config.Env ? config.Env : [];
|
||||||
|
this.Labels = config.Labels;
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,5 +137,5 @@ angular.module('portainer.docker').controller('DashboardController', [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function imagesTotalSize(images) {
|
function imagesTotalSize(images) {
|
||||||
return images.reduce((acc, image) => acc + image.VirtualSize, 0);
|
return images.reduce((acc, image) => acc + image.Size, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Size</td>
|
<td>Size</td>
|
||||||
<td>{{ image.VirtualSize | humansize }}</td>
|
<td>{{ image.Size | humansize }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Created</td>
|
<td>Created</td>
|
||||||
|
|
|
@ -10,6 +10,5 @@ export type DockerImageResponse = {
|
||||||
RepoTags: string[];
|
RepoTags: string[];
|
||||||
SharedSize: number;
|
SharedSize: number;
|
||||||
Size: number;
|
Size: number;
|
||||||
VirtualSize: number;
|
|
||||||
Portainer?: PortainerMetadata;
|
Portainer?: PortainerMetadata;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue