From b38a02f5bad815f25251cd5cd035c5f9357bf55d Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 2 Aug 2024 17:24:18 -0700 Subject: [PATCH] fix: fixes broken image tag in title bar (#3176) --- internal/agent/client.go | 3 --- internal/agent/client_test.go | 3 --- internal/agent/pb/rpc.pb.go | 2 +- internal/agent/pb/rpc_grpc.pb.go | 2 +- internal/agent/pb/types.pb.go | 2 +- internal/agent/server.go | 3 --- internal/docker/client.go | 6 +++--- internal/docker/types.go | 1 - 8 files changed, 6 insertions(+), 16 deletions(-) diff --git a/internal/agent/client.go b/internal/agent/client.go index 3a68a1f2..1251ed78 100644 --- a/internal/agent/client.go +++ b/internal/agent/client.go @@ -246,7 +246,6 @@ func (c *Client) StreamNewContainers(ctx context.Context, containers chan<- dock Image: resp.Container.Image, Labels: resp.Container.Labels, Group: resp.Container.Group, - ImageID: resp.Container.ImageId, Created: resp.Container.Created.AsTime(), State: resp.Container.State, Health: resp.Container.Health, @@ -281,7 +280,6 @@ func (c *Client) FindContainer(containerID string) (docker.Container, error) { Image: response.Container.Image, Labels: response.Container.Labels, Group: response.Container.Group, - ImageID: response.Container.ImageId, Created: response.Container.Created.AsTime(), State: response.Container.State, Health: response.Container.Health, @@ -317,7 +315,6 @@ func (c *Client) ListContainers() ([]docker.Container, error) { Image: container.Image, Labels: container.Labels, Group: container.Group, - ImageID: container.ImageId, Created: container.Created.AsTime(), State: container.State, Health: container.Health, diff --git a/internal/agent/client_test.go b/internal/agent/client_test.go index 80852287..bf5c947f 100644 --- a/internal/agent/client_test.go +++ b/internal/agent/client_test.go @@ -116,7 +116,6 @@ func init() { Name: "test", Host: "localhost", Image: "test", - ImageID: "test", State: "running", Health: "healthy", Group: "test", @@ -149,7 +148,6 @@ func TestFindContainer(t *testing.T) { Name: "test", Host: "localhost", Image: "test", - ImageID: "test", State: "running", Health: "healthy", Group: "test", @@ -176,7 +174,6 @@ func TestListContainers(t *testing.T) { Name: "test", Host: "localhost", Image: "test", - ImageID: "test", State: "running", Health: "healthy", Group: "test", diff --git a/internal/agent/pb/rpc.pb.go b/internal/agent/pb/rpc.pb.go index a7e96781..0c79e390 100644 --- a/internal/agent/pb/rpc.pb.go +++ b/internal/agent/pb/rpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc v5.27.3 // source: rpc.proto package pb diff --git a/internal/agent/pb/rpc_grpc.pb.go b/internal/agent/pb/rpc_grpc.pb.go index 87647b7e..4c1aae84 100644 --- a/internal/agent/pb/rpc_grpc.pb.go +++ b/internal/agent/pb/rpc_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.4.0 -// - protoc v5.27.1 +// - protoc v5.27.3 // source: rpc.proto package pb diff --git a/internal/agent/pb/types.pb.go b/internal/agent/pb/types.pb.go index 78c49e7b..cc8bb93b 100644 --- a/internal/agent/pb/types.pb.go +++ b/internal/agent/pb/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v5.27.1 +// protoc v5.27.3 // source: types.proto package pb diff --git a/internal/agent/server.go b/internal/agent/server.go index 178a6e1e..2180b211 100644 --- a/internal/agent/server.go +++ b/internal/agent/server.go @@ -180,7 +180,6 @@ func (s *server) FindContainer(ctx context.Context, in *pb.FindContainerRequest) Id: container.ID, Name: container.Name, Image: container.Image, - ImageId: container.ImageID, Command: container.Command, Created: timestamppb.New(container.Created), State: container.State, @@ -217,7 +216,6 @@ func (s *server) ListContainers(ctx context.Context, in *pb.ListContainersReques Id: container.ID, Name: container.Name, Image: container.Image, - ImageId: container.ImageID, Created: timestamppb.New(container.Created), State: container.State, Health: container.Health, @@ -263,7 +261,6 @@ func (s *server) StreamContainerStarted(in *pb.StreamContainerStartedRequest, ou Id: container.ID, Name: container.Name, Image: container.Image, - ImageId: container.ImageID, Created: timestamppb.New(container.Created), State: container.State, Health: container.Health, diff --git a/internal/docker/client.go b/internal/docker/client.go index f9d84b3c..a87e9ea8 100644 --- a/internal/docker/client.go +++ b/internal/docker/client.go @@ -368,7 +368,6 @@ func newContainer(c types.Container, host string) Container { ID: c.ID[:12], Name: name, Image: c.Image, - ImageID: c.ImageID, Command: c.Command, Created: time.Unix(c.Created, 0), State: c.State, @@ -390,11 +389,12 @@ func newContainerFromJSON(c types.ContainerJSON, host string) Container { group = c.Config.Labels["dev.dozzle.group"] } + log.Debugf("newContainerFromJSON: %s", c.Config.Image) + container := Container{ ID: c.ID[:12], Name: name, - Image: c.Image, - ImageID: c.Image, + Image: c.Config.Image, Command: strings.Join(c.Config.Entrypoint, " ") + " " + strings.Join(c.Config.Cmd, " "), State: c.State.Status, Host: host, diff --git a/internal/docker/types.go b/internal/docker/types.go index dd628c9d..0befd9bd 100644 --- a/internal/docker/types.go +++ b/internal/docker/types.go @@ -13,7 +13,6 @@ type Container struct { ID string `json:"id"` Name string `json:"name"` Image string `json:"image"` - ImageID string `json:"imageId"` Command string `json:"command"` Created time.Time `json:"created"` StartedAt time.Time `json:"startedAt,omitempty"`