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

hubble: fix Hubble Relay BASE_IMAGE #23636

Merged
merged 3 commits into from
Feb 10, 2023

Conversation

kaworu
Copy link
Member

@kaworu kaworu commented Feb 8, 2023

95a4d37 ("hubble-relay: use distroless as the base image and run as non-root") attempted to use distroless as base image for Hubble Relay instead of scratch.

However, when running make docker-hubble-relay-image the image would be built with --build-arg BASE_IMAGE=scratch effectively overriding the base image "back" to scratch.

This patch make it so BASE_IMAGE is only overridden when set, and honor the Dockerfile's BASE_IMAGE otherwise.

Fix #23374, #23533

@kaworu kaworu added kind/bug This is a bug in the Cilium logic. release-note/misc This PR makes changes that have no direct user impact. area/build Anything to do with the build, more general than area/CI labels Feb 8, 2023
@kaworu kaworu requested review from a team as code owners February 8, 2023 17:21
Copy link
Member

@rolinh rolinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Alex, LGTM!
Note that BASE_IMAGE being overwritten to scratch was never caught up as all images using BASE_IMAGE as ARG were actually based on scratch up to recently when Hubble Relay's base image was changed to distroless static.

@kaworu kaworu force-pushed the pr/kaworu/fix-hubble-relay-BASE_IMAGE branch from f3261fe to 6003d73 Compare February 8, 2023 17:53
@kaworu kaworu requested review from a team as code owners February 8, 2023 17:53
This reverts commit fc2ce0f.

Hubble Relay's base image, distroless nonroot, already set WORKDIR to
/home/nonroot so setting it in the Hubble Relay Dockerfile is a no-op:

    % docker image inspect -f '{{.Config.WorkingDir}}' gcr.io/distroless/static-debian11:nonroot
    /home/nonroot

Signed-off-by: Alexandre Perrin <alex@isovalent.com>
95a4d37 ("hubble-relay: use distroless
as the base image and run as non-root") attempted to use distroless as
base image for Hubble Relay instead of scratch.

However, when running `make docker-hubble-relay-image` the image would
be built with `--build-arg BASE_IMAGE=scratch` effectively overriding
the base image "back" to scratch.

This patch make it so BASE_IMAGE is only overridden when set, and honor
the Dockerfile's BASE_IMAGE otherwise.

Signed-off-by: Alexandre Perrin <alex@isovalent.com>
Before this patch, it was not possible to disable gops for Hubble Relay
through Helm.

Signed-off-by: Alexandre Perrin <alex@isovalent.com>
@kaworu kaworu force-pushed the pr/kaworu/fix-hubble-relay-BASE_IMAGE branch from 6003d73 to f256fad Compare February 8, 2023 18:09
@kaworu
Copy link
Member Author

kaworu commented Feb 8, 2023

/test

Job 'Cilium-PR-K8s-1.16-kernel-4.9' hit: #22578 (97.53% similarity)

@kaworu
Copy link
Member Author

kaworu commented Feb 9, 2023

/test-1.16-4.9

EDIT: previous run hit #22578

@kaworu
Copy link
Member Author

kaworu commented Feb 9, 2023

/ci-gke

EDIT: previous run hit #22368

@kaworu
Copy link
Member Author

kaworu commented Feb 10, 2023

/ci-verifier

EDIT: previous run stuck in Expected — Waiting for status to be reported

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 10, 2023
@pchaigno pchaigno merged commit 06e7034 into cilium:master Feb 10, 2023
@pchaigno
Copy link
Member

@kaworu FYI, you don't have to rerun the test if they failed with a known flake and it's clear it's unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Anything to do with the build, more general than area/CI kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: K8sAgentHubbleTest Hubble Observe Test L3/L4 Flow
5 participants