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/5363/head
parent
90ce62ceaa
commit
9fafe2f11f
|
@ -8,6 +8,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/opencontainers/runc/libcontainer/userns"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rancher/k3s/pkg/agent/templates"
|
||||
|
@ -110,3 +111,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)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package containerd
|
||||
|
@ -8,6 +9,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/rancher/k3s/pkg/agent/templates"
|
||||
util2 "github.com/rancher/k3s/pkg/agent/util"
|
||||
"github.com/rancher/k3s/pkg/daemons/config"
|
||||
|
@ -87,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