mirror of https://github.com/portainer/portainer
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;
|
||||
|
||||
if (data.Portainer && data.Portainer.Agent && data.Portainer.Agent.NodeName) {
|
||||
|
|
|
@ -6,15 +6,22 @@ export function ImageDetailsViewModel(data) {
|
|||
this.Created = data.Created;
|
||||
this.Checked = false;
|
||||
this.RepoTags = data.RepoTags;
|
||||
this.VirtualSize = data.VirtualSize;
|
||||
this.Size = data.Size;
|
||||
this.DockerVersion = data.DockerVersion;
|
||||
this.Os = data.Os;
|
||||
this.Architecture = data.Architecture;
|
||||
this.Author = data.Author;
|
||||
this.Command = data.Config.Cmd;
|
||||
this.Entrypoint = data.ContainerConfig.Entrypoint ? data.ContainerConfig.Entrypoint : '';
|
||||
this.ExposedPorts = data.ContainerConfig.ExposedPorts ? Object.keys(data.ContainerConfig.ExposedPorts) : [];
|
||||
this.Volumes = data.ContainerConfig.Volumes ? Object.keys(data.ContainerConfig.Volumes) : [];
|
||||
this.Env = data.ContainerConfig.Env ? data.ContainerConfig.Env : [];
|
||||
this.Labels = data.ContainerConfig.Labels;
|
||||
|
||||
let config = {};
|
||||
if (data.Config) {
|
||||
config = data.Config; // this is part of OCI images-spec
|
||||
} 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) {
|
||||
return images.reduce((acc, image) => acc + image.VirtualSize, 0);
|
||||
return images.reduce((acc, image) => acc + image.Size, 0);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Size</td>
|
||||
<td>{{ image.VirtualSize | humansize }}</td>
|
||||
<td>{{ image.Size | humansize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Created</td>
|
||||
|
|
|
@ -10,6 +10,5 @@ export type DockerImageResponse = {
|
|||
RepoTags: string[];
|
||||
SharedSize: number;
|
||||
Size: number;
|
||||
VirtualSize: number;
|
||||
Portainer?: PortainerMetadata;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue