90 controller = c
91 } else {
92 logrus.Debug("Getting S3 snapshot cluster ID and server token hash")
93 if err := wait.PollImmediateUntilWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) { 94 if config.Runtime.Core == nil {
95 return false, nil
96 }
6 "crypto/x509"
7 "encoding/base64"
8 "fmt"
9 "io/ioutil" 10 "net/http"
11 "net/textproto"
12 "net/url"
13// EvacuateCgroup2 will handle evacuating the root cgroup in order to enable subtree_control,
14// if running as pid 1 without rootless support.
15func EvacuateCgroup2() error {
16 if os.Getpid() == 1 && !userns.RunningInUserNS() {17 // The root cgroup has to be empty to enable subtree_control, so evacuate it by placing
18 // ourselves in the init cgroup.
19 if err := cgrouputil.EvacuateCgroup2("init"); err != nil {
5import (
6 "os"
7
8 "github.com/containerd/containerd/pkg/userns" 9 "github.com/pkg/errors"
10 "github.com/rootless-containers/rootlesskit/pkg/parent/cgrouputil"
11)
21 return nil, err
22 }
23
24 conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithTimeout(3*time.Second), grpc.WithContextDialer(dialer), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize)))25 if err != nil {
26 return nil, err
27 }
Sometimes a function, variable, constant, field, or whole package becomes redundant or unnecessary but must be kept for compatibility with existing programs. These should not be used except for compatibility with legacy systems.