Skip to content

Comments

build: Use normalized platform spec for ARG expansion#66

Open
slimreaper35 wants to merge 1 commit intokonflux-ci:mainfrom
slimreaper35:build-args
Open

build: Use normalized platform spec for ARG expansion#66
slimreaper35 wants to merge 1 commit intokonflux-ci:mainfrom
slimreaper35:build-args

Conversation

@slimreaper35
Copy link
Member

No description provided.

The ARG variables for multi-platform builds should use a normalized
platform spec. This ensures consistent formatting across different
platform string representations, particularly for edge cases like
architecture normalization.

--
https://github.com/containers/buildah/blob/c97d402ccd8dbc5442c3b9fd952fece3f22fbce4/internal/util/util.go#L44
https://github.com/containers/common/blob/a5ccdae846b629b5ceaefa6ffd5c6511409c3487/libimage/platform/platform.go#L20

Signed-off-by: Michal Šoltis <msoltis@redhat.com>
@slimreaper35 slimreaper35 requested a review from a team as a code owner February 23, 2026 08:52
@snyk-io
Copy link

snyk-io bot commented Feb 23, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@chmeliik chmeliik left a comment

Choose a reason for hiding this comment

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

Isn't DefaultSpec() always normalized? I think Normalize() is more for user input.

@slimreaper35
Copy link
Member Author

Isn't DefaultSpec() always normalized? I think Normalize() is more for user input.

I didn't find the normalization anywhere.

I encountered this while running integration tests, and the platform variant was part of the TARGETPLATFORM/BUILDPLATFORM string:

Test Failure: image label: BUILDPLATFORM=linux/arm64; containerfile label: BUILDPLATFORM=linux/arm64/v8

So the normalization removes the v8 variant, and the test passes. I believe this condition could be dropped as well (unless there is a different solution).

@chmeliik
Copy link
Contributor

chmeliik commented Feb 23, 2026

Isn't DefaultSpec() always normalized? I think Normalize() is more for user input.

I didn't find the normalization anywhere.

I encountered this while running integration tests, and the platform variant was part of the TARGETPLATFORM/BUILDPLATFORM string:

Test Failure: image label: BUILDPLATFORM=linux/arm64; containerfile label: BUILDPLATFORM=linux/arm64/v8

So the normalization removes the v8 variant, and the test passes.

Ah, interesting. In that case yeah, normalization makes sense. Could you also submit a similar patch to https://github.com/konflux-ci/dockerfile-json/ (the dev branch)?

I believe this condition could be dropped as well (unless there is a different solution).

I think the condition will have to be more specific and also expect empty for arm64 v8. Because the variant label should apparently be empty on arm64 v8 but not any other arm variant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants