chore(push): run unregistry only if containerd image store enabled for docker

This commit is contained in:
Pasha Sviderski
2025-10-09 12:48:51 +10:00
parent e8b4dd0bd1
commit 521ccf2026
+9
View File
@@ -437,6 +437,12 @@ func (m *Machine) Run(ctx context.Context) error {
var unreg *unregistry.Registry
if m.config.ContainerdSockPath != "" {
isContainerdStore, err := m.dockerService.IsContainerdImageStoreEnabled(ctx)
if err != nil {
return fmt.Errorf("check if Docker uses containerd image store: %w", err)
}
if isContainerdStore {
// Create an embedded container registry listening on the machine IP address and
// using the local Docker (containerd) image store as its backend.
unreg, err = unregistry.NewRegistry(unregistry.Config{
@@ -449,6 +455,9 @@ func (m *Machine) Run(ctx context.Context) error {
if err != nil {
return fmt.Errorf("create embedded registry: %w", err)
}
} else {
slog.Warn("Skipping embedded unregistry setup as Docker is not using the containerd image store.")
}
} else {
slog.Warn("Skipping embedded unregistry setup as the containerd socket path is not configured.")
}