mirror of https://github.com/k3s-io/k3s
add a wrapper around the containerd.New call to fix and pass the proper npipe connector
Signed-off-by: Luther Monson <luther.monson@gmail.com>pull/5361/head
parent
1339626a5b
commit
13191da58a
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue