Skip to content

Commit

Permalink
Bump kaniko and remediate a CVE with a patch.
Browse files Browse the repository at this point in the history
I sent this upstream at GoogleContainerTools/kaniko#2916

Signed-off-by: Dan Lorenc <dlorenc@chainguard.dev>
  • Loading branch information
dlorenc committed Dec 19, 2023
1 parent f5813e7 commit 9bd89d8
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kaniko.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: kaniko
version: 1.19.0
epoch: 1
version: 1.19.1
epoch: 0
description: Build Container Images In Kubernetes
copyright:
- license: Apache-2.0
Expand All @@ -18,7 +18,15 @@ pipeline:
with:
repository: https://github.com/GoogleContainerTools/kaniko
tag: v${{package.version}}
expected-commit: 1556a56004ef630fc3d9a8671e95f62c30678c5c
expected-commit: 8d40aa97d95929de6b074d351cadcc5630842063

- uses: patch
with:
patches: bump-docker.patch switch-pkg.patch

- uses: go/bump
with:
deps: github.com/docker/docker@v24.0.7

- runs: |
mkdir -p "${{targets.destdir}}"/usr/bin
Expand Down
15 changes: 15 additions & 0 deletions kaniko/bump-docker.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/pkg/commands/stopsignal.go b/pkg/commands/stopsignal.go
index f73a70f4..964b6b70 100644
--- a/pkg/commands/stopsignal.go
+++ b/pkg/commands/stopsignal.go
@@ -19,9 +19,9 @@ package commands
import (
"github.com/GoogleContainerTools/kaniko/pkg/dockerfile"
"github.com/GoogleContainerTools/kaniko/pkg/util"
- "github.com/docker/docker/pkg/signal"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/moby/buildkit/frontend/dockerfile/instructions"
+ "github.com/moby/sys/signal"
"github.com/sirupsen/logrus"
)

25 changes: 25 additions & 0 deletions kaniko/switch-pkg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/pkg/util/fs_util.go b/pkg/util/fs_util.go
index 992eeaa5..058558b7 100644
--- a/pkg/util/fs_util.go
+++ b/pkg/util/fs_util.go
@@ -33,10 +33,10 @@ import (
"github.com/GoogleContainerTools/kaniko/pkg/config"
"github.com/GoogleContainerTools/kaniko/pkg/timing"
"github.com/docker/docker/pkg/archive"
- "github.com/docker/docker/pkg/fileutils"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/karrick/godirwalk"
"github.com/moby/buildkit/frontend/dockerfile/dockerignore"
+ "github.com/moby/patternmatcher"
otiai10Cpy "github.com/otiai10/copy"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@@ -788,7 +788,7 @@ func (c FileContext) ExcludesFile(path string) bool {
return false
}
}
- match, err := fileutils.Matches(path, c.ExcludedFiles)
+ match, err := patternmatcher.Matches(path, c.ExcludedFiles)
if err != nil {
logrus.Errorf("Error matching, including %s in build: %v", path, err)
return false

0 comments on commit 9bd89d8

Please sign in to comment.