mirror of
https://github.com/unraid/api.git
synced 2025-12-31 21:49:57 -06:00
fix: container names always null (#1335)
This commit is contained in:
@@ -124,6 +124,7 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image',
|
image: 'test-image',
|
||||||
imageId: 'test-image-id',
|
imageId: 'test-image-id',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
state: ContainerState.EXITED,
|
state: ContainerState.EXITED,
|
||||||
status: 'Exited',
|
status: 'Exited',
|
||||||
labels: {},
|
labels: {},
|
||||||
@@ -132,6 +133,7 @@ describe('DockerService', () => {
|
|||||||
},
|
},
|
||||||
networkSettings: {},
|
networkSettings: {},
|
||||||
mounts: [],
|
mounts: [],
|
||||||
|
names: ['/test-container'],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -175,6 +177,7 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image',
|
image: 'test-image',
|
||||||
imageId: 'test-image-id',
|
imageId: 'test-image-id',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
state: ContainerState.RUNNING,
|
state: ContainerState.RUNNING,
|
||||||
status: 'Up 2 hours',
|
status: 'Up 2 hours',
|
||||||
labels: {},
|
labels: {},
|
||||||
@@ -183,6 +186,7 @@ describe('DockerService', () => {
|
|||||||
},
|
},
|
||||||
networkSettings: {},
|
networkSettings: {},
|
||||||
mounts: [],
|
mounts: [],
|
||||||
|
names: ['/test-container'],
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(mockContainer.start).toHaveBeenCalled();
|
expect(mockContainer.start).toHaveBeenCalled();
|
||||||
@@ -226,6 +230,7 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image',
|
image: 'test-image',
|
||||||
imageId: 'test-image-id',
|
imageId: 'test-image-id',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
state: ContainerState.EXITED,
|
state: ContainerState.EXITED,
|
||||||
status: 'Exited',
|
status: 'Exited',
|
||||||
labels: {},
|
labels: {},
|
||||||
@@ -234,6 +239,7 @@ describe('DockerService', () => {
|
|||||||
},
|
},
|
||||||
networkSettings: {},
|
networkSettings: {},
|
||||||
mounts: [],
|
mounts: [],
|
||||||
|
names: ['/test-container'],
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(mockContainer.stop).toHaveBeenCalledWith({ t: 10 });
|
expect(mockContainer.stop).toHaveBeenCalledWith({ t: 10 });
|
||||||
@@ -376,6 +382,8 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image',
|
image: 'test-image',
|
||||||
imageId: 'test-image-id',
|
imageId: 'test-image-id',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
|
names: ['/test-container'],
|
||||||
state: ContainerState.RUNNING,
|
state: ContainerState.RUNNING,
|
||||||
status: 'Up 2 hours',
|
status: 'Up 2 hours',
|
||||||
labels: {},
|
labels: {},
|
||||||
@@ -393,6 +401,8 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image2',
|
image: 'test-image2',
|
||||||
imageId: 'test-image-id2',
|
imageId: 'test-image-id2',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
|
names: ['/test-container2'],
|
||||||
state: ContainerState.EXITED,
|
state: ContainerState.EXITED,
|
||||||
status: 'Exited',
|
status: 'Exited',
|
||||||
labels: {},
|
labels: {},
|
||||||
@@ -421,6 +431,8 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image',
|
image: 'test-image',
|
||||||
imageId: 'test-image-id',
|
imageId: 'test-image-id',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
|
names: ['/test-container'],
|
||||||
state: ContainerState.RUNNING,
|
state: ContainerState.RUNNING,
|
||||||
status: 'Up 2 hours',
|
status: 'Up 2 hours',
|
||||||
labels: {},
|
labels: {},
|
||||||
@@ -438,6 +450,8 @@ describe('DockerService', () => {
|
|||||||
image: 'test-image2',
|
image: 'test-image2',
|
||||||
imageId: 'test-image-id2',
|
imageId: 'test-image-id2',
|
||||||
ports: [],
|
ports: [],
|
||||||
|
sizeRootFs: undefined,
|
||||||
|
names: ['/test-container2'],
|
||||||
state: ContainerState.EXITED,
|
state: ContainerState.EXITED,
|
||||||
status: 'Exited',
|
status: 'Exited',
|
||||||
labels: {},
|
labels: {},
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export class DockerService implements OnModuleInit {
|
|||||||
public transformContainer(container: Docker.ContainerInfo): DockerContainer {
|
public transformContainer(container: Docker.ContainerInfo): DockerContainer {
|
||||||
return camelCaseKeys<DockerContainer>(
|
return camelCaseKeys<DockerContainer>(
|
||||||
{
|
{
|
||||||
|
names: container.Names,
|
||||||
labels: container.Labels ?? {},
|
labels: container.Labels ?? {},
|
||||||
sizeRootFs: undefined,
|
sizeRootFs: undefined,
|
||||||
imageId: container.ImageID,
|
imageId: container.ImageID,
|
||||||
|
|||||||
Reference in New Issue
Block a user