Skip to content

Commit

Permalink
chore(deps): bump github.com/docker/docker from 25.0.4+incompatible t…
Browse files Browse the repository at this point in the history
…o 26.0.0+incompatible
  • Loading branch information
aaron-prindle committed Mar 26, 2024
1 parent 4ef48fe commit 83e5262
Show file tree
Hide file tree
Showing 101 changed files with 1,410 additions and 1,069 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
remove-haskell: 'true'
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: '1.20'
go-version: '1.22'
- uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3
- uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v1

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ jobs:
steps:
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v4.01
with:
go-version: '1.20'
- uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3

go-version: '1.22'
- run: make test
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/GoogleContainerTools/kaniko

go 1.21
go 1.22

require (
cloud.google.com/go/storage v1.39.1
Expand All @@ -12,7 +12,7 @@ require (
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20231213181459-b0fcec718dc6
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589
github.com/containerd/cgroups v1.1.0 // indirect
github.com/docker/docker v25.0.4+incompatible
github.com/docker/docker v26.0.0+incompatible
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.11.0
github.com/golang/mock v1.6.0
Expand Down Expand Up @@ -174,6 +174,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/swarmkit/v2 v2.0.0-20230315203717-e28e8ba9bc83 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ github.com/docker/cli v25.0.3+incompatible h1:KLeNs7zws74oFuVhgZQ5ONGZiXUUdgsdy6
github.com/docker/cli v25.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v25.0.4+incompatible h1:XITZTrq+52tZyZxUOtFIahUf3aH367FLxJzt9vZeAF8=
github.com/docker/docker v25.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=
github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
Expand Down Expand Up @@ -358,6 +358,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/buildkit v0.13.0 h1:reVR1Y+rbNIUQ9jf0Q1YZVH5a/nhOixZsl+HJ9qQEGI=
github.com/moby/buildkit v0.13.0/go.mod h1:aNmNQKLBFYAOFuzQjR3VA27/FijlvtBD1pjNwTSN37k=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
Expand Down
47 changes: 22 additions & 25 deletions integration/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ const (
//WarmerImage is the name of the kaniko cache warmer image
WarmerImage = "warmer-image"

dockerPrefix = "docker-"
kanikoPrefix = "kaniko-"
buildContextPath = "/workspace"
cacheDir = "/workspace/cache"
baseImageToCache = "gcr.io/google-appengine/debian9@sha256:1d6a9a6d106bd795098f60f4abb7083626354fa6735e81743c7f8cfca11259f0"
dockerPrefix = "docker-"
kanikoPrefix = "kaniko-"
buildContextPath = "/workspace"
cacheDir = "/workspace/cache"
baseImageToCache = "gcr.io/google-appengine/debian9@sha256:1d6a9a6d106bd795098f60f4abb7083626354fa6735e81743c7f8cfca11259f0"
testRelativePrefix = "test_relative_"
)

// Arguments to build Dockerfiles with, used for both docker and kaniko builds
Expand Down Expand Up @@ -343,15 +344,13 @@ func (d *DockerFileBuilder) BuildImageWithContext(t *testing.T, config *integrat
func populateVolumeCache() error {
_, ex, _, _ := runtime.Caller(0)
cwd := filepath.Dir(ex)
warmerCmd := exec.Command("docker",
append([]string{"run", "--net=host",
"-d",
"-v", os.Getenv("HOME") + "/.config/gcloud:/root/.config/gcloud",
"-v", cwd + ":/workspace",
WarmerImage,
"-c", cacheDir,
"-i", baseImageToCache},
)...,
warmerCmd := exec.Command("docker", []string{"run", "--net=host",
"-d",
"-v", os.Getenv("HOME") + "/.config/gcloud:/root/.config/gcloud",
"-v", cwd + ":" + buildContextPath,
WarmerImage,
"-c", cacheDir,
"-i", baseImageToCache}...,
)

if _, err := RunCommandWithoutTest(warmerCmd); err != nil {
Expand All @@ -377,7 +376,7 @@ func (d *DockerFileBuilder) buildCachedImage(config *integrationTestConfig, cach
kanikoImage := GetVersionedKanikoImage(imageRepo, dockerfile, version)

dockerRunFlags := []string{"run", "--net=host",
"-v", cwd + ":/workspace",
"-v", cwd + ":" + buildContextPath,
"-e", benchmarkEnv}
dockerRunFlags = addServiceAccountFlags(dockerRunFlags, serviceAccount)
dockerRunFlags = append(dockerRunFlags, ExecutorImage,
Expand All @@ -404,15 +403,13 @@ func (d *DockerFileBuilder) buildRelativePathsImage(imageRepo, dockerfile, servi
_, ex, _, _ := runtime.Caller(0)
cwd := filepath.Dir(ex)

dockerImage := GetDockerImage(imageRepo, "test_relative_"+dockerfile)
kanikoImage := GetKanikoImage(imageRepo, "test_relative_"+dockerfile)
dockerImage := GetDockerImage(imageRepo, testRelativePrefix+dockerfile)
kanikoImage := GetKanikoImage(imageRepo, testRelativePrefix+dockerfile)

dockerCmd := exec.Command("docker",
append([]string{"build",
"-t", dockerImage,
"-f", dockerfile,
"./context"},
)...,
dockerCmd := exec.Command("docker", []string{"build",
"-t", dockerImage,
"-f", dockerfile,
"./context"}...,
)

timer := timing.Start(dockerfile + "_docker")
Expand All @@ -422,7 +419,7 @@ func (d *DockerFileBuilder) buildRelativePathsImage(imageRepo, dockerfile, servi
return fmt.Errorf("Failed to build image %s with docker command \"%s\": %w %s", dockerImage, dockerCmd.Args, err, string(out))
}

dockerRunFlags := []string{"run", "--net=host", "-v", cwd + ":/workspace"}
dockerRunFlags := []string{"run", "--net=host", "-v", cwd + ":" + buildContextPath}
dockerRunFlags = addServiceAccountFlags(dockerRunFlags, serviceAccount)
dockerRunFlags = append(dockerRunFlags, ExecutorImage,
"-f", dockerfile,
Expand Down Expand Up @@ -482,7 +479,7 @@ func buildKanikoImage(

dockerRunFlags := []string{"run", "--net=host",
"-e", benchmarkEnv,
"-v", contextDir + ":/workspace",
"-v", contextDir + ":" + buildContextPath,
"-v", benchmarkDir + ":/kaniko/benchmarks",
}

Expand Down
17 changes: 8 additions & 9 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,10 @@ func testGitBuildcontextHelper(t *testing.T, repo string) {

// Build with docker
dockerImage := GetDockerImage(config.imageRepo, "Dockerfile_test_git")
dockerCmd := exec.Command("docker",
append([]string{"build",
"-t", dockerImage,
"-f", dockerfile,
repo})...)
dockerCmd := exec.Command("docker", []string{"build",
"-t", dockerImage,
"-f", dockerfile,
repo}...)
out, err := RunCommandWithoutTest(dockerCmd)
if err != nil {
t.Errorf("Failed to build image %s with docker command %q: %s %s", dockerImage, dockerCmd.Args, err, string(out))
Expand Down Expand Up @@ -735,7 +734,7 @@ func TestRelativePaths(t *testing.T) {

dockerfile := "Dockerfile_relative_copy"

t.Run("test_relative_"+dockerfile, func(t *testing.T) {
t.Run(testRelativePrefix+dockerfile, func(t *testing.T) {
t.Parallel()

dockerfile = filepath.Join("./dockerfiles", dockerfile)
Expand All @@ -752,8 +751,8 @@ func TestRelativePaths(t *testing.T) {
t.Fatal(err)
}

dockerImage := GetDockerImage(config.imageRepo, "test_relative_"+dockerfile)
kanikoImage := GetKanikoImage(config.imageRepo, "test_relative_"+dockerfile)
dockerImage := GetDockerImage(config.imageRepo, testRelativePrefix+dockerfile)
kanikoImage := GetKanikoImage(config.imageRepo, testRelativePrefix+dockerfile)

diff := containerDiff(t, daemonPrefix+dockerImage, kanikoImage, "--no-cache")

Expand Down Expand Up @@ -799,7 +798,7 @@ func TestExitCodePropagation(t *testing.T) {
}

//try to build the same image with kaniko the error code should match with the one from the plain docker build
contextVolume := fmt.Sprintf("%s:/workspace", context)
contextVolume := fmt.Sprintf("%s:"+buildContextPath, context)

dockerFlags = []string{
"run",
Expand Down
10 changes: 6 additions & 4 deletions integration/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"text/template"
)

const kanikoTestPath = "job/kaniko-test-"

type K8sConfig struct {
KanikoImage string
Context string
Expand Down Expand Up @@ -96,14 +98,14 @@ func TestK8s(t *testing.T) {
RunCommand(kubeCmd, t)

t.Logf("Waiting for K8s kaniko build job to finish: %s\n",
"job/kaniko-test-"+job.Name)
kanikoTestPath+job.Name)

kubeWaitCmd := exec.Command("kubectl", "wait", "--for=condition=complete", "--timeout=2m",
"job/kaniko-test-"+job.Name)
kanikoTestPath+job.Name)
if out, errR := RunCommandWithoutTest(kubeWaitCmd); errR != nil {
t.Log(kubeWaitCmd.Args)
t.Log(string(out))
descCmd := exec.Command("kubectl", "describe", "job/kaniko-test-"+job.Name)
descCmd := exec.Command("kubectl", "describe", kanikoTestPath+job.Name)
outD, errD := RunCommandWithoutTest(descCmd)
if errD != nil {
t.Error(errD)
Expand All @@ -119,7 +121,7 @@ func TestK8s(t *testing.T) {
t.Log(string(outD))
}

logsCmd := exec.Command("kubectl", "logs", "--all-containers", "job/kaniko-test-"+job.Name)
logsCmd := exec.Command("kubectl", "logs", "--all-containers", kanikoTestPath+job.Name)
outL, errL := RunCommandWithoutTest(logsCmd)
if errL != nil {
t.Error(errL)
Expand Down
3 changes: 1 addition & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GREEN='\033[0;32m'
RESET='\033[0m'

echo "Running go tests..."
go test -cover -coverprofile=out/coverage.out -v -timeout 60s `go list ./... | grep -v vendor | grep -v integration` | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/''
go test -cover -coverprofile=out/coverage.out -v -timeout 120s `go list ./... | grep -v vendor | grep -v integration` | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/''
GO_TEST_EXIT_CODE=${PIPESTATUS[0]}
if [[ $GO_TEST_EXIT_CODE -ne 0 ]]; then
exit $GO_TEST_EXIT_CODE
Expand All @@ -33,7 +33,6 @@ echo "Running validation scripts..."
scripts=(
"$DIR/../hack/boilerplate.sh"
"$DIR/../hack/gofmt.sh"
"$DIR/../hack/linter.sh"
)
fail=0
for s in "${scripts[@]}"
Expand Down
13 changes: 11 additions & 2 deletions vendor/github.com/docker/docker/api/common.go

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

20 changes: 9 additions & 11 deletions vendor/github.com/docker/docker/api/swagger.yaml

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

9 changes: 7 additions & 2 deletions vendor/github.com/docker/docker/api/types/backend/backend.go

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

Loading

0 comments on commit 83e5262

Please sign in to comment.