Skip to content

Commit 41eab50

Browse files
committed
[docker-up] Cleanup lints and fix build issues
Tool: gitpod/catfood.gitpod.cloud
1 parent 52424be commit 41eab50

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

components/docker-up/BUILD.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ packages:
55
- go.mod
66
- go.sum
77
- "docker-up/**"
8+
- "dockerd/**"
89
- dependencies.sh
910
deps:
1011
- components/common-go:lib

components/docker-up/docker-up/main.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ func tryAuthenticateForAllHosts(imageAuth string) {
234234
splitCredentials := func(host, s string) (string, string, error) {
235235
credentials, err := base64.StdEncoding.DecodeString(s)
236236
if err != nil {
237-
return "", "", fmt.Errorf("Cannot decode docker credentials for host %s: %w", host, err)
237+
return "", "", fmt.Errorf("cannot decode docker credentials for host %s: %w", host, err)
238238
}
239239
parts := strings.SplitN(string(credentials), ":", 2)
240240
if len(parts) < 2 {
241-
return "", "", fmt.Errorf("Credentials in wrong format")
241+
return "", "", fmt.Errorf("credentials in wrong format")
242242
}
243243
return parts[0], parts[1], nil
244244
}
@@ -263,7 +263,7 @@ func tryAuthenticateForAllHosts(imageAuth string) {
263263
loginCmd.Stdin = bytes.NewBufferString(password)
264264
loginErr := loginCmd.Run()
265265
if loginErr != nil {
266-
log.WithError(loginErr).Warnf("Unable to authenticate with host %s, skipping.%s", host)
266+
log.WithError(loginErr).Warnf("Unable to authenticate with host %s, skipping.", host)
267267
continue
268268
}
269269
log.Infof("Authenticated with host %s", host)
@@ -339,7 +339,8 @@ func installDocker() error {
339339
}
340340

341341
switch hdr.Typeflag {
342-
case tar.TypeReg, tar.TypeRegA:
342+
343+
case tar.TypeReg, tar.TypeRegA: //lint:ignore SA1019 backwards compatibility
343344
file, err := os.OpenFile(dstpath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, mode)
344345
if err != nil {
345346
return xerrors.Errorf("unable to create file: %v", err)
@@ -466,12 +467,12 @@ func detectRuncVersion(output string) (major, minor int, err error) {
466467

467468
major, err = strconv.Atoi(n[0])
468469
if err != nil {
469-
return 0, 0, xerrors.Errorf("could not parse major %s: %w", n[0])
470+
return 0, 0, xerrors.Errorf("could not parse major %s: %w", n[0], err)
470471
}
471472

472473
minor, err = strconv.Atoi(n[1])
473474
if err != nil {
474-
return 0, 0, xerrors.Errorf("could not parse minor %s: %w", n[1])
475+
return 0, 0, xerrors.Errorf("could not parse minor %s: %w", n[1], err)
475476
}
476477

477478
return major, minor, nil

components/docker-up/dockerd/args.go

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License.AGPL.txt in the project root for license information.
4+
15
package dockerd
26

37
import (

components/docker-up/dockerd/args_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
1+
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
22
// Licensed under the GNU Affero General Public License (AGPL).
33
// See License.AGPL.txt in the project root for license information.
44

components/docker-up/go.mod

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
module github.com/gitpod-io/gitpod/docker-up
22

3-
go 1.22
3+
go 1.22.0
4+
5+
toolchain go1.23.3
46

57
require (
6-
github.com/opencontainers/runtime-spec v1.1.0
7-
github.com/rootless-containers/rootlesskit v1.1.0
8+
github.com/opencontainers/runtime-spec v1.2.0
9+
github.com/rootless-containers/rootlesskit v1.1.1
810
github.com/sirupsen/logrus v1.9.3
9-
github.com/spf13/pflag v1.0.5
10-
github.com/vishvananda/netlink v1.1.0
11-
golang.org/x/sys v0.11.0
12-
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f
11+
github.com/spf13/pflag v1.0.6
12+
github.com/vishvananda/netlink v1.3.0
13+
golang.org/x/sys v0.30.0
14+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da
1315
)
1416

15-
require (
16-
github.com/stretchr/testify v1.8.1 // indirect
17-
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
18-
)
17+
require github.com/vishvananda/netns v0.0.4 // indirect
1918

2019
replace github.com/gitpod-io/gitpod/common-go => ../common-go // leeway

components/docker-up/go.sum

+18-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)