xiaods / k8e

Using a deprecated function, variable, constant or field GO-W1009
Anti-pattern
Major
7 months ago2 years old
wait.PollImmediateUntilWithContext is deprecated: This method does not return errors from context, use PollUntilContextCancel. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release.
 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				}
"io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details.
  6	"crypto/x509"
  7	"encoding/base64"
  8	"fmt"
  9	"io/ioutil" 10	"net/http"
 11	"net/textproto"
 12	"net/url"
userns.RunningInUserNS is deprecated: use [userns.RunningInUserNS].
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 {
"github.com/containerd/containerd/pkg/userns" is deprecated: use github.com/moby/sys/userns
 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)
grpc.WithTimeout is deprecated: this DialOption is not supported by NewClient. Will be supported throughout 1.x.
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	}