mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 12:03:33 +00:00
chore(push): run unregistry only if containerd image store enabled for docker
This commit is contained in:
@@ -437,6 +437,12 @@ func (m *Machine) Run(ctx context.Context) error {
|
|||||||
|
|
||||||
var unreg *unregistry.Registry
|
var unreg *unregistry.Registry
|
||||||
if m.config.ContainerdSockPath != "" {
|
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
|
// Create an embedded container registry listening on the machine IP address and
|
||||||
// using the local Docker (containerd) image store as its backend.
|
// using the local Docker (containerd) image store as its backend.
|
||||||
unreg, err = unregistry.NewRegistry(unregistry.Config{
|
unreg, err = unregistry.NewRegistry(unregistry.Config{
|
||||||
@@ -449,6 +455,9 @@ func (m *Machine) Run(ctx context.Context) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("create embedded registry: %w", err)
|
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 {
|
} else {
|
||||||
slog.Warn("Skipping embedded unregistry setup as the containerd socket path is not configured.")
|
slog.Warn("Skipping embedded unregistry setup as the containerd socket path is not configured.")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user