Skip to content

Commit

Permalink
Merge pull request #3237 from saschagrunert/grep-fix
Browse files Browse the repository at this point in the history
distroless-iptables: fix `grep` command
  • Loading branch information
k8s-ci-robot authored Aug 31, 2023
2 parents ff914c1 + 2e81bda commit 958447d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ dependencies:
match: "DEBIAN_BASE_VERSION: 'bookworm-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"

- name: "registry.k8s.io/build-image/distroless-iptables"
version: v0.3.0
version: v0.3.1
refPaths:
- path: images/build/distroless-iptables/Makefile
match: IMAGE_VERSION\ \?=\ v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
Expand Down
2 changes: 1 addition & 1 deletion images/build/distroless-iptables/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ REGISTRY?="gcr.io/k8s-staging-build-image"
IMAGE=$(REGISTRY)/distroless-iptables

TAG ?= $(shell git describe --tags --always --dirty)
IMAGE_VERSION ?= v0.3.0
IMAGE_VERSION ?= v0.3.1
CONFIG ?= distroless
BASEIMAGE ?= debian:bookworm-slim
GORUNNER_VERSION ?= v2.3.1-go1.21.0-bookworm.0
Expand Down
2 changes: 1 addition & 1 deletion images/build/distroless-iptables/distroless/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ FROM ${GORUNNERIMAGE} as gorunner

# We need to use distroless:base here as tzdata, glibc and some other base packages
# are required
FROM gcr.io/distroless/base as intermediate
FROM gcr.io/distroless/base-debian12 as intermediate

ARG SKIP_WRAPPER_CHECK

Expand Down
14 changes: 10 additions & 4 deletions images/build/distroless-iptables/distroless/package-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ package_to_copyright() {
# stage_file stages the filepath $1 to $2, following symlinks
# and staging copyrights
stage_file() {
cp -a --parents "${1}" "${2}"
# /lib is a symlink to /usr/lib in debian 12, means we just stick to
# /usr/lib for all libraries to avoid separating symlinks with the actual binaries
from="${1}"
if [[ $from = /lib/* ]]; then
from="/usr$from"
fi
cp -a --parents "${from}" "${2}"
# recursively follow symlinks
if [[ -L "${1}" ]]; then
stage_file "$(cd "$(dirname "${1}")" || exit; realpath -s "$(readlink "${1}")")" "${2}"
if [[ -L "${from}" ]]; then
stage_file "$(cd "$(dirname "${from}")" || exit; realpath -s "$(readlink "${from}")")" "${2}"
fi
# get the package so we can stage package metadata as well
package="$(file_to_package "${1}")"
package="$(file_to_package "${from}")"

# files like /usr/lib/x86_64-linux-gnu/libc.so.6 will return no package
if [[ "$package" != "" ]]; then
Expand Down

0 comments on commit 958447d

Please sign in to comment.