Skip to content

Commit

Permalink
Merge pull request #16799 from rhatdan/build
Browse files Browse the repository at this point in the history
Add podman buildx version support
  • Loading branch information
openshift-merge-robot authored Dec 14, 2022
2 parents 1b677c5 + 43e307b commit 415a702
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions cmd/podman/images/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package images

import (
"fmt"

"github.com/containers/buildah/define"
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/containers/podman/v4/cmd/podman/validate"
"github.com/spf13/cobra"
)

var (
versionDescription = `Print build version`
versionCmd = &cobra.Command{
Use: "version",
Args: validate.NoArgs,
Short: "Print build version",
Long: versionDescription,
RunE: version,
ValidArgsFunction: completion.AutocompleteNone,
}
)

func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: versionCmd,
Parent: buildxCmd,
})
}

func version(cmd *cobra.Command, args []string) error {
fmt.Printf("%s %s\n", define.Package, define.Version)
return nil
}
6 changes: 6 additions & 0 deletions test/system/070-build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ VOLUME /a/b/c
VOLUME ['/etc/foo', '/etc/bar']
EOF

run_podman info --format '{{ .Host.BuildahVersion}}'
BUILDAH_VERSION=$output

run_podman buildx version
is "$output" "buildah ${BUILDAH_VERSION}" "buildx version contains Buildah version"

run_podman buildx build --load -t build_test --format=docker $tmpdir
is "$output" ".*COMMIT" "COMMIT seen in log"

Expand Down

0 comments on commit 415a702

Please sign in to comment.