Skip to content

Commit

Permalink
[docker-up] Cleanup lints and fix build issues
Browse files Browse the repository at this point in the history
Tool: gitpod/catfood.gitpod.cloud
  • Loading branch information
geropl committed Feb 7, 2025
1 parent 52424be commit 41eab50
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
1 change: 1 addition & 0 deletions components/docker-up/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ packages:
- go.mod
- go.sum
- "docker-up/**"
- "dockerd/**"
- dependencies.sh
deps:
- components/common-go:lib
Expand Down
13 changes: 7 additions & 6 deletions components/docker-up/docker-up/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ func tryAuthenticateForAllHosts(imageAuth string) {
splitCredentials := func(host, s string) (string, string, error) {
credentials, err := base64.StdEncoding.DecodeString(s)
if err != nil {
return "", "", fmt.Errorf("Cannot decode docker credentials for host %s: %w", host, err)
return "", "", fmt.Errorf("cannot decode docker credentials for host %s: %w", host, err)
}
parts := strings.SplitN(string(credentials), ":", 2)
if len(parts) < 2 {
return "", "", fmt.Errorf("Credentials in wrong format")
return "", "", fmt.Errorf("credentials in wrong format")
}
return parts[0], parts[1], nil
}
Expand All @@ -263,7 +263,7 @@ func tryAuthenticateForAllHosts(imageAuth string) {
loginCmd.Stdin = bytes.NewBufferString(password)
loginErr := loginCmd.Run()
if loginErr != nil {
log.WithError(loginErr).Warnf("Unable to authenticate with host %s, skipping.%s", host)
log.WithError(loginErr).Warnf("Unable to authenticate with host %s, skipping.", host)
continue
}
log.Infof("Authenticated with host %s", host)
Expand Down Expand Up @@ -339,7 +339,8 @@ func installDocker() error {
}

switch hdr.Typeflag {
case tar.TypeReg, tar.TypeRegA:

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

major, err = strconv.Atoi(n[0])
if err != nil {
return 0, 0, xerrors.Errorf("could not parse major %s: %w", n[0])
return 0, 0, xerrors.Errorf("could not parse major %s: %w", n[0], err)
}

minor, err = strconv.Atoi(n[1])
if err != nil {
return 0, 0, xerrors.Errorf("could not parse minor %s: %w", n[1])
return 0, 0, xerrors.Errorf("could not parse minor %s: %w", n[1], err)
}

return major, minor, nil
Expand Down
4 changes: 4 additions & 0 deletions components/docker-up/dockerd/args.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License.AGPL.txt in the project root for license information.

package dockerd

import (
Expand Down
2 changes: 1 addition & 1 deletion components/docker-up/dockerd/args_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License.AGPL.txt in the project root for license information.

Expand Down
21 changes: 10 additions & 11 deletions components/docker-up/go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
module github.com/gitpod-io/gitpod/docker-up

go 1.22
go 1.22.0

toolchain go1.23.3

require (
github.com/opencontainers/runtime-spec v1.1.0
github.com/rootless-containers/rootlesskit v1.1.0
github.com/opencontainers/runtime-spec v1.2.0
github.com/rootless-containers/rootlesskit v1.1.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5
github.com/vishvananda/netlink v1.1.0
golang.org/x/sys v0.11.0
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f
github.com/spf13/pflag v1.0.6
github.com/vishvananda/netlink v1.3.0
golang.org/x/sys v0.30.0
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da
)

require (
github.com/stretchr/testify v1.8.1 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
)
require github.com/vishvananda/netns v0.0.4 // indirect

replace github.com/gitpod-io/gitpod/common-go => ../common-go // leeway
41 changes: 18 additions & 23 deletions components/docker-up/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 41eab50

Please sign in to comment.