Skip to content

Commit

Permalink
Merge pull request #22673 from tnk4on/fix-farm-remote
Browse files Browse the repository at this point in the history
Fix podman-remote support for `podman farm build`
  • Loading branch information
openshift-merge-bot[bot] authored May 14, 2024
2 parents 8ae59f8 + 3b1c735 commit a6aa5c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
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

1 comment on commit a6aa5c8

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

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

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.