Skip to content

Commit 8045318

Browse files
committed
go: update dependencies
Signed-off-by: Matthew Penner <[email protected]>
1 parent 024fe54 commit 8045318

File tree

7 files changed

+166
-152
lines changed

7 files changed

+166
-152
lines changed

cmd/diagnostics.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/AlecAivazis/survey/v2/terminal"
1919
"github.com/apex/log"
2020
"github.com/docker/docker/api/types"
21+
dockersystem "github.com/docker/docker/api/types/system"
2122
"github.com/docker/docker/pkg/parsers/kernel"
2223
"github.com/docker/docker/pkg/parsers/operatingsystem"
2324
"github.com/spf13/cobra"
@@ -206,18 +207,18 @@ func diagnosticsCmdRun(*cobra.Command, []string) {
206207
}
207208
}
208209

209-
func getDockerInfo() (types.Version, types.Info, error) {
210+
func getDockerInfo() (types.Version, dockersystem.Info, error) {
210211
client, err := environment.Docker()
211212
if err != nil {
212-
return types.Version{}, types.Info{}, err
213+
return types.Version{}, dockersystem.Info{}, err
213214
}
214215
dockerVersion, err := client.ServerVersion(context.Background())
215216
if err != nil {
216-
return types.Version{}, types.Info{}, err
217+
return types.Version{}, dockersystem.Info{}, err
217218
}
218219
dockerInfo, err := client.Info(context.Background())
219220
if err != nil {
220-
return types.Version{}, types.Info{}, err
221+
return types.Version{}, dockersystem.Info{}, err
221222
}
222223
return dockerVersion, dockerInfo, nil
223224
}

environment/docker.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77

88
"emperror.dev/errors"
99
"github.com/apex/log"
10-
"github.com/docker/docker/api/types"
1110
"github.com/docker/docker/api/types/network"
1211
"github.com/docker/docker/client"
1312

@@ -39,7 +38,7 @@ func ConfigureDocker(ctx context.Context) error {
3938
}
4039

4140
nw := config.Get().Docker.Network
42-
resource, err := cli.NetworkInspect(ctx, nw.Name, types.NetworkInspectOptions{})
41+
resource, err := cli.NetworkInspect(ctx, nw.Name, network.InspectOptions{})
4342
if err != nil {
4443
if !client.IsErrNotFound(err) {
4544
return err
@@ -72,9 +71,10 @@ func ConfigureDocker(ctx context.Context) error {
7271
// Creates a new network on the machine if one does not exist already.
7372
func createDockerNetwork(ctx context.Context, cli *client.Client) error {
7473
nw := config.Get().Docker.Network
75-
_, err := cli.NetworkCreate(ctx, nw.Name, types.NetworkCreate{
74+
enableIPv6 := true
75+
_, err := cli.NetworkCreate(ctx, nw.Name, network.CreateOptions{
7676
Driver: nw.Driver,
77-
EnableIPv6: true,
77+
EnableIPv6: &enableIPv6,
7878
Internal: nw.IsInternal,
7979
IPAM: &network.IPAM{
8080
Config: []network.IPAMConfig{{

environment/docker/container.go

+24-23
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import (
1212
"emperror.dev/errors"
1313
"github.com/apex/log"
1414
"github.com/buger/jsonparser"
15-
"github.com/docker/docker/api/types"
1615
"github.com/docker/docker/api/types/container"
16+
"github.com/docker/docker/api/types/image"
1717
"github.com/docker/docker/api/types/mount"
18+
"github.com/docker/docker/api/types/network"
1819
"github.com/docker/docker/client"
1920

2021
"github.com/pterodactyl/wings/config"
@@ -199,14 +200,15 @@ func (e *Environment) Create() error {
199200
networkName := "ip-" + strings.ReplaceAll(strings.ReplaceAll(a.DefaultMapping.Ip, ".", "-"), ":", "-")
200201
networkMode = container.NetworkMode(networkName)
201202

202-
if _, err := e.client.NetworkInspect(ctx, networkName, types.NetworkInspectOptions{}); err != nil {
203+
if _, err := e.client.NetworkInspect(ctx, networkName, network.InspectOptions{}); err != nil {
203204
if !client.IsErrNotFound(err) {
204205
return err
205206
}
206207

207-
if _, err := e.client.NetworkCreate(ctx, networkName, types.NetworkCreate{
208+
enableIPv6 := false
209+
if _, err := e.client.NetworkCreate(ctx, networkName, network.CreateOptions{
208210
Driver: "bridge",
209-
EnableIPv6: false,
211+
EnableIPv6: &enableIPv6,
210212
Internal: false,
211213
Attachable: false,
212214
Ingress: false,
@@ -343,12 +345,12 @@ func (e *Environment) Readlog(lines int) ([]string, error) {
343345
// late, and we don't need to block all the servers from booting just because
344346
// of that. I'd imagine in a lot of cases an outage shouldn't affect users too
345347
// badly. It'll at least keep existing servers working correctly if anything.
346-
func (e *Environment) ensureImageExists(image string) error {
348+
func (e *Environment) ensureImageExists(img string) error {
347349
e.Events().Publish(environment.DockerImagePullStarted, "")
348350
defer e.Events().Publish(environment.DockerImagePullCompleted, "")
349351

350352
// Images prefixed with a ~ are local images that we do not need to try and pull.
351-
if strings.HasPrefix(image, "~") {
353+
if strings.HasPrefix(img, "~") {
352354
return nil
353355
}
354356

@@ -361,7 +363,7 @@ func (e *Environment) ensureImageExists(image string) error {
361363
// Get a registry auth configuration from the config.
362364
var registryAuth *config.RegistryConfiguration
363365
for registry, c := range config.Get().Docker.Registries {
364-
if !strings.HasPrefix(image, registry) {
366+
if !strings.HasPrefix(img, registry) {
365367
continue
366368
}
367369

@@ -371,7 +373,7 @@ func (e *Environment) ensureImageExists(image string) error {
371373
}
372374

373375
// Get the ImagePullOptions.
374-
imagePullOptions := types.ImagePullOptions{All: false}
376+
imagePullOptions := image.PullOptions{All: false}
375377
if registryAuth != nil {
376378
b64, err := registryAuth.Base64()
377379
if err != nil {
@@ -382,23 +384,23 @@ func (e *Environment) ensureImageExists(image string) error {
382384
imagePullOptions.RegistryAuth = b64
383385
}
384386

385-
out, err := e.client.ImagePull(ctx, image, imagePullOptions)
387+
out, err := e.client.ImagePull(ctx, img, imagePullOptions)
386388
if err != nil {
387-
images, ierr := e.client.ImageList(ctx, types.ImageListOptions{})
389+
images, ierr := e.client.ImageList(ctx, image.ListOptions{})
388390
if ierr != nil {
389391
// Well damn, something has gone really wrong here, just go ahead and abort there
390392
// isn't much anything we can do to try and self-recover from this.
391393
return errors.Wrap(ierr, "environment/docker: failed to list images")
392394
}
393395

394-
for _, img := range images {
395-
for _, t := range img.RepoTags {
396-
if t != image {
396+
for _, img2 := range images {
397+
for _, t := range img2.RepoTags {
398+
if t != img {
397399
continue
398400
}
399401

400402
log.WithFields(log.Fields{
401-
"image": image,
403+
"image": img,
402404
"container_id": e.Id,
403405
"err": err.Error(),
404406
}).Warn("unable to pull requested image from remote source, however the image exists locally")
@@ -409,11 +411,11 @@ func (e *Environment) ensureImageExists(image string) error {
409411
}
410412
}
411413

412-
return errors.Wrapf(err, "environment/docker: failed to pull \"%s\" image for server", image)
414+
return errors.Wrapf(err, "environment/docker: failed to pull \"%s\" image for server", img)
413415
}
414416
defer out.Close()
415417

416-
log.WithField("image", image).Debug("pulling docker image... this could take a bit of time")
418+
log.WithField("image", img).Debug("pulling docker image... this could take a bit of time")
417419

418420
// I'm not sure what the best approach here is, but this will block execution until the image
419421
// is done being pulled, which is what we need.
@@ -431,22 +433,21 @@ func (e *Environment) ensureImageExists(image string) error {
431433
return err
432434
}
433435

434-
log.WithField("image", image).Debug("completed docker image pull")
436+
log.WithField("image", img).Debug("completed docker image pull")
435437

436438
return nil
437439
}
438440

439441
func (e *Environment) convertMounts() []mount.Mount {
440-
var out []mount.Mount
441-
442-
for _, m := range e.Configuration.Mounts() {
443-
out = append(out, mount.Mount{
442+
mounts := e.Configuration.Mounts()
443+
out := make([]mount.Mount, len(mounts))
444+
for i, m := range mounts {
445+
out[i] = mount.Mount{
444446
Type: mount.TypeBind,
445447
Source: m.Source,
446448
Target: m.Target,
447449
ReadOnly: m.ReadOnly,
448-
})
450+
}
449451
}
450-
451452
return out
452453
}

environment/docker/stats.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"time"
99

1010
"emperror.dev/errors"
11-
"github.com/docker/docker/api/types"
11+
"github.com/docker/docker/api/types/container"
1212

1313
"github.com/pterodactyl/wings/environment"
1414
)
@@ -57,7 +57,7 @@ func (e *Environment) pollResources(ctx context.Context) error {
5757
case <-ctx.Done():
5858
return ctx.Err()
5959
default:
60-
var v types.StatsJSON
60+
var v container.StatsResponse
6161
if err := dec.Decode(&v); err != nil {
6262
if err != io.EOF && !errors.Is(err, context.Canceled) {
6363
e.log().WithField("error", err).Warn("error while processing Docker stats output for container")
@@ -95,15 +95,15 @@ func (e *Environment) pollResources(ctx context.Context) error {
9595
}
9696
}
9797

98-
// The "docker stats" CLI call does not return the same value as the types.MemoryStats.Usage
98+
// The "docker stats" CLI call does not return the same value as the [container.MemoryStats].Usage
9999
// value which can be rather confusing to people trying to compare panel usage to
100100
// their stats output.
101101
//
102102
// This math is from their CLI repository in order to show the same values to avoid people
103103
// bothering me about it. It should also reflect a slightly more correct memory value anyways.
104104
//
105105
// @see https://github.com/docker/cli/blob/96e1d1d6/cli/command/container/stats_helpers.go#L227-L249
106-
func calculateDockerMemory(stats types.MemoryStats) uint64 {
106+
func calculateDockerMemory(stats container.MemoryStats) uint64 {
107107
if v, ok := stats.Stats["total_inactive_file"]; ok && v < stats.Usage {
108108
return stats.Usage - v
109109
}
@@ -119,7 +119,7 @@ func calculateDockerMemory(stats types.MemoryStats) uint64 {
119119
// by the defined CPU limits on the container.
120120
//
121121
// @see https://github.com/docker/cli/blob/aa097cf1aa19099da70930460250797c8920b709/cli/command/container/stats_helpers.go#L166
122-
func calculateDockerAbsoluteCpu(pStats types.CPUStats, stats types.CPUStats) float64 {
122+
func calculateDockerAbsoluteCpu(pStats container.CPUStats, stats container.CPUStats) float64 {
123123
// Calculate the change in CPU usage between the current and previous reading.
124124
cpuDelta := float64(stats.CPUUsage.TotalUsage) - float64(pStats.CPUUsage.TotalUsage)
125125

go.mod

+31-30
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ require (
1616
github.com/buger/jsonparser v1.1.1
1717
github.com/cenkalti/backoff/v4 v4.3.0
1818
github.com/creasty/defaults v1.8.0
19-
github.com/docker/docker v25.0.6+incompatible
19+
github.com/docker/docker v27.3.1+incompatible
2020
github.com/docker/go-connections v0.5.0
21-
github.com/fatih/color v1.17.0
21+
github.com/fatih/color v1.18.0
2222
github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf
23-
github.com/gabriel-vasile/mimetype v1.4.5
23+
github.com/gabriel-vasile/mimetype v1.4.7
2424
github.com/gammazero/workerpool v1.1.3
2525
github.com/gbrlsnchs/jwt/v3 v3.0.1
2626
github.com/gin-gonic/gin v1.10.0
@@ -33,34 +33,34 @@ require (
3333
github.com/juju/ratelimit v1.0.2
3434
github.com/klauspost/compress v1.17.11
3535
github.com/klauspost/pgzip v1.2.6
36-
github.com/magiconair/properties v1.8.7
36+
github.com/magiconair/properties v1.8.9
3737
github.com/mattn/go-colorable v0.1.13
3838
github.com/mholt/archives v0.0.0-20241207175349-5e373c52f8aa
3939
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
4040
github.com/patrickmn/go-cache v2.1.0+incompatible
41-
github.com/pkg/sftp v1.13.6
41+
github.com/pkg/sftp v1.13.7
4242
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
4343
github.com/spf13/cobra v1.8.1
44-
github.com/stretchr/testify v1.9.0
45-
golang.org/x/crypto v0.26.0
46-
golang.org/x/sync v0.9.0
47-
golang.org/x/sys v0.24.0
44+
github.com/stretchr/testify v1.10.0
45+
golang.org/x/crypto v0.30.0
46+
golang.org/x/sync v0.10.0
47+
golang.org/x/sys v0.28.0
4848
gopkg.in/ini.v1 v1.67.0
4949
gopkg.in/yaml.v2 v2.4.0
5050
gopkg.in/yaml.v3 v3.0.1
51-
gorm.io/gorm v1.25.11
51+
gorm.io/gorm v1.25.12
5252
)
5353

5454
require (
5555
github.com/Microsoft/go-winio v0.6.2 // indirect
56-
github.com/Microsoft/hcsshim v0.12.5 // indirect
56+
github.com/Microsoft/hcsshim v0.12.9 // indirect
5757
github.com/STARRY-S/zip v0.2.1 // indirect
5858
github.com/andybalholm/brotli v1.1.1 // indirect
5959
github.com/bodgit/plumbing v1.3.0 // indirect
6060
github.com/bodgit/sevenzip v1.6.0 // indirect
6161
github.com/bodgit/windows v1.0.1 // indirect
62-
github.com/bytedance/sonic v1.12.2 // indirect
63-
github.com/bytedance/sonic/loader v0.2.0 // indirect
62+
github.com/bytedance/sonic v1.12.5 // indirect
63+
github.com/bytedance/sonic/loader v0.2.1 // indirect
6464
github.com/cloudwego/base64x v0.1.4 // indirect
6565
github.com/cloudwego/iasm v0.2.0 // indirect
6666
github.com/containerd/log v0.1.0 // indirect
@@ -70,14 +70,14 @@ require (
7070
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
7171
github.com/dustin/go-humanize v1.0.1 // indirect
7272
github.com/felixge/httpsnoop v1.0.4 // indirect
73-
github.com/gammazero/deque v0.2.1 // indirect
73+
github.com/gammazero/deque v1.0.0 // indirect
7474
github.com/gin-contrib/sse v0.1.0 // indirect
7575
github.com/glebarez/go-sqlite v1.22.0 // indirect
7676
github.com/go-logr/logr v1.4.2 // indirect
7777
github.com/go-logr/stdr v1.2.2 // indirect
7878
github.com/go-playground/locales v0.14.1 // indirect
7979
github.com/go-playground/universal-translator v0.18.1 // indirect
80-
github.com/go-playground/validator/v10 v10.22.0 // indirect
80+
github.com/go-playground/validator/v10 v10.23.0 // indirect
8181
github.com/goccy/go-json v0.10.3 // indirect
8282
github.com/gogo/protobuf v1.3.2 // indirect
8383
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -88,18 +88,19 @@ require (
8888
github.com/jinzhu/now v1.1.5 // indirect
8989
github.com/json-iterator/go v1.1.12 // indirect
9090
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
91-
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
91+
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
9292
github.com/kr/fs v0.1.0 // indirect
9393
github.com/leodido/go-urn v1.4.0 // indirect
9494
github.com/magefile/mage v1.15.0 // indirect
9595
github.com/mattn/go-isatty v0.0.20 // indirect
9696
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
97+
github.com/moby/docker-image-spec v1.3.1 // indirect
9798
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
9899
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
99100
github.com/modern-go/reflect2 v1.0.2 // indirect
100101
github.com/morikuni/aec v1.0.0 // indirect
101102
github.com/ncruces/go-strftime v0.1.9 // indirect
102-
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78 // indirect
103+
github.com/nwaples/rardecode/v2 v2.0.1 // indirect
103104
github.com/opencontainers/go-digest v1.0.0 // indirect
104105
github.com/opencontainers/image-spec v1.1.0 // indirect
105106
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
@@ -115,25 +116,25 @@ require (
115116
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
116117
github.com/ugorji/go/codec v1.2.12 // indirect
117118
github.com/ulikunitz/xz v0.5.12 // indirect
118-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
119-
go.opentelemetry.io/otel v1.29.0 // indirect
119+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect
120+
go.opentelemetry.io/otel v1.32.0 // indirect
120121
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
121-
go.opentelemetry.io/otel/metric v1.29.0 // indirect
122-
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
123-
go.opentelemetry.io/otel/trace v1.29.0 // indirect
122+
go.opentelemetry.io/otel/metric v1.32.0 // indirect
123+
go.opentelemetry.io/otel/trace v1.32.0 // indirect
124124
go.uber.org/atomic v1.11.0 // indirect
125125
go.uber.org/multierr v1.11.0 // indirect
126126
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
127-
golang.org/x/arch v0.9.0 // indirect
128-
golang.org/x/net v0.28.0 // indirect
129-
golang.org/x/term v0.23.0 // indirect
130-
golang.org/x/text v0.20.0 // indirect
127+
golang.org/x/arch v0.12.0 // indirect
128+
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d // indirect
129+
golang.org/x/net v0.32.0 // indirect
130+
golang.org/x/term v0.27.0 // indirect
131+
golang.org/x/text v0.21.0 // indirect
131132
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
132-
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
133-
google.golang.org/protobuf v1.34.2 // indirect
133+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
134+
google.golang.org/protobuf v1.35.2 // indirect
134135
gotest.tools/v3 v3.0.2 // indirect
135-
modernc.org/libc v1.60.0 // indirect
136+
modernc.org/libc v1.61.4 // indirect
136137
modernc.org/mathutil v1.6.0 // indirect
137138
modernc.org/memory v1.8.0 // indirect
138-
modernc.org/sqlite v1.32.0 // indirect
139+
modernc.org/sqlite v1.34.2 // indirect
139140
)

0 commit comments

Comments
 (0)