Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distroless-iptables: fix grep command #3237

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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