Skip to content

Commit

Permalink
Merge pull request #815 from danielcooperxyz/main
Browse files Browse the repository at this point in the history
Add supported platform APIs to `pack report` (#810)
  • Loading branch information
jromero authored Aug 25, 2020
2 parents d7503fd + bb2ff31 commit 6ebfc96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions acceptance/testdata/pack_fixtures/report_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ Pack:

Default Lifecycle Version: 0.9.1

Supported Platform APIs: 0.3, 0.4

Config:
default-builder-image = "{{ .DefaultBuilder }}"
6 changes: 6 additions & 0 deletions internal/commands/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/spf13/cobra"

"github.com/buildpacks/pack/internal/build"
"github.com/buildpacks/pack/internal/builder"
"github.com/buildpacks/pack/internal/config"
"github.com/buildpacks/pack/logging"
Expand Down Expand Up @@ -48,6 +49,8 @@ func generateOutput(writer io.Writer, version string, explicit bool) error {
Default Lifecycle Version: {{ .DefaultLifecycleVersion }}
Supported Platform APIs: {{ .SupportedPlatformAPIs }}
Config:
{{ .Config -}}`))

Expand All @@ -68,11 +71,14 @@ Config:
configData = strings.TrimRight(padded.String(), " \n")
}

platformAPIs := strings.Join(build.SupportedPlatformAPIVersions.AsStrings(), ", ")

return tpl.Execute(writer, map[string]string{
"Version": version,
"OS": runtime.GOOS,
"Arch": runtime.GOARCH,
"DefaultLifecycleVersion": builder.DefaultLifecycleVersion,
"SupportedPlatformAPIs": platformAPIs,
"Config": configData,
})
}
Expand Down

0 comments on commit 6ebfc96

Please sign in to comment.