update golangci-lint to v2.1.5
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -138,28 +138,28 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
|
||||
hc.NetworkMode = container.NetworkMode(d.netMode)
|
||||
}
|
||||
if d.memory != 0 {
|
||||
hc.Resources.Memory = int64(d.memory)
|
||||
hc.Memory = int64(d.memory)
|
||||
}
|
||||
if d.memorySwap != 0 {
|
||||
hc.Resources.MemorySwap = int64(d.memorySwap)
|
||||
hc.MemorySwap = int64(d.memorySwap)
|
||||
}
|
||||
if d.cpuQuota != 0 {
|
||||
hc.Resources.CPUQuota = d.cpuQuota
|
||||
hc.CPUQuota = d.cpuQuota
|
||||
}
|
||||
if d.cpuPeriod != 0 {
|
||||
hc.Resources.CPUPeriod = d.cpuPeriod
|
||||
hc.CPUPeriod = d.cpuPeriod
|
||||
}
|
||||
if d.cpuShares != 0 {
|
||||
hc.Resources.CPUShares = d.cpuShares
|
||||
hc.CPUShares = d.cpuShares
|
||||
}
|
||||
if d.cpusetCpus != "" {
|
||||
hc.Resources.CpusetCpus = d.cpusetCpus
|
||||
hc.CpusetCpus = d.cpusetCpus
|
||||
}
|
||||
if d.cpusetMems != "" {
|
||||
hc.Resources.CpusetMems = d.cpusetMems
|
||||
hc.CpusetMems = d.cpusetMems
|
||||
}
|
||||
if len(d.gpus) > 0 && d.hasGPUCapability(ctx, cfg.Image, d.gpus) {
|
||||
hc.Resources.DeviceRequests = d.gpus
|
||||
hc.DeviceRequests = d.gpus
|
||||
}
|
||||
if info, err := d.DockerAPI.Info(ctx); err == nil {
|
||||
if info.CgroupDriver == "cgroupfs" {
|
||||
@@ -187,7 +187,7 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
|
||||
return err
|
||||
}
|
||||
if err == nil {
|
||||
if err := d.copyToContainer(ctx, d.InitConfig.Files); err != nil {
|
||||
if err := d.copyToContainer(ctx, d.Files); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.start(ctx); err != nil {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/docker/buildx/util/platformutil"
|
||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
@@ -43,7 +43,7 @@ type DeploymentOpt struct {
|
||||
LimitsCPU string
|
||||
LimitsMemory string
|
||||
LimitsEphemeralStorage string
|
||||
Platforms []v1.Platform
|
||||
Platforms []ocispecs.Platform
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -260,10 +260,10 @@ func toRootless(d *appsv1.Deployment) error {
|
||||
Type: corev1.SeccompProfileTypeUnconfined,
|
||||
},
|
||||
}
|
||||
if d.Spec.Template.ObjectMeta.Annotations == nil {
|
||||
d.Spec.Template.ObjectMeta.Annotations = make(map[string]string, 1)
|
||||
if d.Spec.Template.Annotations == nil {
|
||||
d.Spec.Template.Annotations = make(map[string]string, 1)
|
||||
}
|
||||
d.Spec.Template.ObjectMeta.Annotations["container.apparmor.security.beta.kubernetes.io/"+containerName] = "unconfined"
|
||||
d.Spec.Template.Annotations["container.apparmor.security.beta.kubernetes.io/"+containerName] = "unconfined"
|
||||
|
||||
// Dockerfile has `VOLUME /home/user/.local/share/buildkit` by default too,
|
||||
// but the default VOLUME does not work with rootless on Google's Container-Optimized OS
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import (
|
||||
dockerclient "github.com/docker/docker/client"
|
||||
"github.com/moby/buildkit/client"
|
||||
"github.com/moby/buildkit/util/tracing/delegated"
|
||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -35,7 +35,7 @@ type InitConfig struct {
|
||||
Files map[string][]byte
|
||||
DriverOpts map[string]string
|
||||
Auth Auth
|
||||
Platforms []specs.Platform
|
||||
Platforms []ocispecs.Platform
|
||||
ContextPathHash string
|
||||
DialMeta map[string][]string
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func (d *Driver) Bootstrap(ctx context.Context, l progress.Logger) error {
|
||||
}
|
||||
return progress.Wrap("[internal] waiting for connection", l, func(_ progress.SubLogger) error {
|
||||
cancelCtx, cancel := context.WithCancelCause(ctx)
|
||||
ctx, _ := context.WithTimeoutCause(cancelCtx, 20*time.Second, errors.WithStack(context.DeadlineExceeded)) //nolint:govet,lostcancel // no need to manually cancel this context as we already rely on parent
|
||||
ctx, _ := context.WithTimeoutCause(cancelCtx, 20*time.Second, errors.WithStack(context.DeadlineExceeded)) //nolint:govet // no need to manually cancel this context as we already rely on parent
|
||||
defer func() { cancel(errors.WithStack(context.Canceled)) }()
|
||||
return c.Wait(ctx)
|
||||
})
|
||||
@@ -101,7 +101,7 @@ func (d *Driver) Client(ctx context.Context, opts ...client.ClientOpt) (*client.
|
||||
}
|
||||
|
||||
func (d *Driver) Dial(ctx context.Context) (net.Conn, error) {
|
||||
addr := d.InitConfig.EndpointAddr
|
||||
addr := d.EndpointAddr
|
||||
ch, err := connhelper.GetConnectionHelper(addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -112,7 +112,7 @@ func (d *Driver) Dial(ctx context.Context) (net.Conn, error) {
|
||||
|
||||
network, addr, ok := strings.Cut(addr, "://")
|
||||
if !ok {
|
||||
return nil, errors.Errorf("invalid endpoint address: %s", d.InitConfig.EndpointAddr)
|
||||
return nil, errors.Errorf("invalid endpoint address: %s", d.EndpointAddr)
|
||||
}
|
||||
|
||||
conn, err := util.DialContext(ctx, network, addr)
|
||||
|
||||
Reference in New Issue
Block a user