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

Move platform code to its own directory #1693

Merged
merged 1 commit into from Oct 12, 2023

Conversation

umohnani8
Copy link
Member

Move the platform code into its own directory
under libimage so it can be used by farm build in
podman without causing the binary size to increase a lot.

@umohnani8
Copy link
Member Author

Needed to reduce binary bloat size from changes in containers/podman#20050.
@vrothberg @rhatdan @Luap99 PTAL

@vrothberg
Copy link
Member

vrothberg commented Oct 11, 2023

Doesn't compile.

# github.com/containers/common/libimage/platform
libimage/platform/platform.go:75:10: undefined: Image
# github.com/containers/common/libimage
libimage/runtime.go:187:17: undefined: PlatformPolicy
libimage/runtime.go:286:54: undefined: NormalizePlatform
libimage/runtime.go:430:44: image.matchesPlatform undefined (type *Image has no field or method matchesPlatform)
libimage/runtime.go:438:8: undefined: PlatformPolicyDefault
libimage/runtime.go:440:8: undefined: PlatformPolicyWarn
libimage/copier.go:242:96: undefined: NormalizePlatform
libimage/pull.go:168:31: image.matchesPlatform undefined (type *Image has no field or method matchesPlatform)

func (i *Image) matchesPlatform(ctx context.Context, os, arch, variant string) (error, bool, error) must continue living in libimage

@vrothberg
Copy link
Member

vrothberg commented Oct 11, 2023

PlatformPolicy could be moved to libimage/define. I think this also requires an immediate vendor-PR against Podman since it's probably breaking Podman compilation.

libimage/normalize_test.go Outdated Show resolved Hide resolved
@umohnani8
Copy link
Member Author

Buildah vendor PR: containers/buildah#5085
Podman vendor PR: containers/podman#20338

@umohnani8
Copy link
Member Author

Tests here and in buildah are green, PTAL. Once merged I will update the buildah vendor PR and then the podman vendor PR

libimage/platform/platform.go Outdated Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/normalize_test.go Outdated Show resolved Hide resolved
libimage/normalize_test.go Outdated Show resolved Hide resolved
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, umohnani8

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Move the platform code into its own directory
under libimage so it can be used by farm build in
podman without causing the binary size to increase a lot.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2023

LGTM

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2023

Of course we just broke your vendors into Buildah/Podman.

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2023

@vrothberg @Luap99 PTAL

@rhatdan
Copy link
Member

rhatdan commented Oct 12, 2023

@lsm5 @mheon @baude @ashley-cui PTAL

@mheon
Copy link
Member

mheon commented Oct 12, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 12, 2023
@openshift-ci openshift-ci bot merged commit 44a1d29 into containers:main Oct 12, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants