Skip to content

Commit

Permalink
Fix podman-remote support for podman farm build
Browse files Browse the repository at this point in the history
Signed-off-by: Shion Tanaka <[email protected]>
  • Loading branch information
tnk4on committed May 11, 2024
1 parent ed4a36c commit 3b1c735
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

0 comments on commit 3b1c735

Please sign in to comment.