1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

fix: fixes panic in agent with stopped containers (#3167)

This commit is contained in:
Amir Raminfar
2024-07-30 19:31:14 -07:00
committed by GitHub
parent b4277603cf
commit 657643e6ce
7 changed files with 45 additions and 76 deletions

View File

@@ -112,18 +112,16 @@ func init() {
})
client.On("FindContainer", "123456").Return(docker.Container{
ID: "123456",
Name: "test",
Host: "localhost",
Image: "test",
ImageID: "test",
StartedAt: &time.Time{},
State: "running",
Health: "healthy",
Group: "test",
Command: "test",
Created: time.Time{},
Tty: true,
ID: "123456",
Name: "test",
Host: "localhost",
Image: "test",
ImageID: "test",
State: "running",
Health: "healthy",
Group: "test",
Command: "test",
Tty: true,
Labels: map[string]string{
"test": "test",
},
@@ -147,18 +145,16 @@ func TestFindContainer(t *testing.T) {
container, _ := rpc.FindContainer("123456")
assert.Equal(t, container, docker.Container{
ID: "123456",
Name: "test",
Host: "localhost",
Image: "test",
ImageID: "test",
StartedAt: &time.Time{},
State: "running",
Health: "healthy",
Group: "test",
Command: "test",
Created: time.Time{},
Tty: true,
ID: "123456",
Name: "test",
Host: "localhost",
Image: "test",
ImageID: "test",
State: "running",
Health: "healthy",
Group: "test",
Command: "test",
Tty: true,
Labels: map[string]string{
"test": "test",
},
@@ -176,18 +172,16 @@ func TestListContainers(t *testing.T) {
assert.Equal(t, containers, []docker.Container{
{
ID: "123456",
Name: "test",
Host: "localhost",
Image: "test",
ImageID: "test",
StartedAt: &time.Time{},
State: "running",
Health: "healthy",
Group: "test",
Command: "test",
Created: time.Time{},
Tty: true,
ID: "123456",
Name: "test",
Host: "localhost",
Image: "test",
ImageID: "test",
State: "running",
Health: "healthy",
Group: "test",
Command: "test",
Tty: true,
Labels: map[string]string{
"test": "test",
},