From 3f70018e7c4e07beb9bbb88c7652d01e9fd9b3ff Mon Sep 17 00:00:00 2001 From: Pavel Sviderski Date: Wed, 30 Apr 2025 14:18:28 +1000 Subject: [PATCH] fix: import cycle in pkg/api --- pkg/api/container.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/api/container.go b/pkg/api/container.go index 1a021441..40a585a8 100644 --- a/pkg/api/container.go +++ b/pkg/api/container.go @@ -9,10 +9,12 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/go-units" - "github.com/psviderski/uncloud/internal/machine/docker" ) const ( + // DockerNetworkName is the name of the Docker network used by uncloud. Keep the value in sync with NetworkName + // in internal/machine/docker/manager.go. + DockerNetworkName = "uncloud" LabelManaged = "uncloud.managed" LabelServiceID = "uncloud.service.id" LabelServiceName = "uncloud.service.name" @@ -94,7 +96,7 @@ func (c *Container) HumanState() (string, error) { // UncloudNetworkIP returns the IP address of the container in the uncloud Docker network. func (c *Container) UncloudNetworkIP() netip.Addr { - network, ok := c.NetworkSettings.Networks[docker.NetworkName] + network, ok := c.NetworkSettings.Networks[DockerNetworkName] if !ok { // Container is not connected to the uncloud Docker network (could be host network). return netip.Addr{}