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

Fix podman-remote support for podman farm build #22673

Merged
merged 1 commit into from
May 14, 2024
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
5 changes: 4 additions & 1 deletion cmd/podman/common/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,14 @@ func DefineBuildFlags(cmd *cobra.Command, buildOpts *BuildFlagsWrapper, isFarmBu
_ = flags.MarkHidden("disable-content-trust")
_ = flags.MarkHidden("sign-by")
_ = flags.MarkHidden("signature-policy")
_ = flags.MarkHidden("tls-verify")
_ = flags.MarkHidden("compress")
_ = flags.MarkHidden("output")
_ = flags.MarkHidden("logsplit")
_ = flags.MarkHidden("cw")
// Support for farm build in podman-remote
if !isFarmBuild {
_ = flags.MarkHidden("tls-verify")
}
}
if isFarmBuild {
for _, f := range FarmBuildHiddenFlags {
Expand Down
4 changes: 2 additions & 2 deletions pkg/domain/infra/tunnel/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ func (ir *ImageEngine) ManifestPush(ctx context.Context, name, destination strin

// ManifestListClear clears out all instances from a manifest list
func (ir *ImageEngine) ManifestListClear(ctx context.Context, name string) (string, error) {
listContents, err := manifests.InspectListData(ctx, name, &manifests.InspectOptions{})
listContents, err := manifests.InspectListData(ir.ClientCtx, name, &manifests.InspectOptions{})
if err != nil {
return "", err
}

for _, instance := range listContents.Manifests {
if _, err := manifests.Remove(ctx, name, instance.Digest.String(), &manifests.RemoveOptions{}); err != nil {
if _, err := manifests.Remove(ir.ClientCtx, name, instance.Digest.String(), &manifests.RemoveOptions{}); err != nil {
return "", err
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/farm/001-farm.bats
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ EOF

@test "farm - build on farm node only (podman-remote)" {
iname="test-image-5"
# ManifestAdd only
echo "Running test with ManifestAdd only..."
run_podman --remote farm build --authfile $AUTHFILE --tls-verify=false -t $REGISTRY/$iname $FARM_TMPDIR
assert "$output" =~ "Farm \"$FARMNAME\" ready"

# ManifestListClear and ManifestAdd
echo "Running test with ManifestListClear and ManifestAdd..."
run_podman --remote farm build --authfile $AUTHFILE --tls-verify=false -t $REGISTRY/$iname $FARM_TMPDIR
assert "$output" =~ "Farm \"$FARMNAME\" ready"

Expand Down