Commit 13191da5 authored by Luther Monson's avatar Luther Monson

add a wrapper around the containerd.New call to fix and pass the proper npipe connector

parent 1339626a
......@@ -9,6 +9,7 @@ import (
"os"
"time"
"github.com/containerd/containerd"
"github.com/k3s-io/k3s/pkg/agent/templates"
util2 "github.com/k3s-io/k3s/pkg/agent/util"
"github.com/k3s-io/k3s/pkg/cgroups"
......@@ -112,3 +113,12 @@ func CriConnection(ctx context.Context, address string) (*grpc.ClientConn, error
return conn, nil
}
func Client(address string) (*containerd.Client, error) {
addr, _, err := util.GetAddressAndDialer("unix://" + address)
if err != nil {
return nil, err
}
return containerd.New(addr)
}
......@@ -9,6 +9,7 @@ import (
"os"
"time"
"github.com/containerd/containerd"
"github.com/k3s-io/k3s/pkg/agent/templates"
util2 "github.com/k3s-io/k3s/pkg/agent/util"
"github.com/k3s-io/k3s/pkg/daemons/config"
......@@ -88,3 +89,12 @@ func CriConnection(ctx context.Context, address string) (*grpc.ClientConn, error
return conn, nil
}
func Client(address string) (*containerd.Client, error) {
addr, _, err := util.GetAddressAndDialer(address)
if err != nil {
return nil, err
}
return containerd.New(addr)
}
......@@ -150,7 +150,7 @@ func preloadImages(ctx context.Context, cfg *config.Node) error {
return nil
}
client, err := containerd.New(cfg.Containerd.Address)
client, err := Client(cfg.Containerd.Address)
if err != nil {
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment