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