From 801590be83e19145676de4609aee4e0370986761 Mon Sep 17 00:00:00 2001 From: Mikey Boldt Date: Thu, 18 Nov 2021 11:02:06 -0600 Subject: [PATCH] Fix default buildpack API version. It was incorrectly pulling the latest supported platform API version. Explicitly declare the default version instead of dynamically pulling, as updates may require changes to the buildpack tempalte. Signed-off-by: Mikey Boldt --- internal/commands/buildpack_new.go | 3 +-- internal/commands/buildpack_new_test.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/commands/buildpack_new.go b/internal/commands/buildpack_new.go index df1508a0d..fc938245c 100644 --- a/internal/commands/buildpack_new.go +++ b/internal/commands/buildpack_new.go @@ -9,7 +9,6 @@ import ( "github.com/spf13/cobra" - "github.com/buildpacks/pack/internal/build" "github.com/buildpacks/pack/internal/style" "github.com/buildpacks/pack/pkg/client" "github.com/buildpacks/pack/pkg/dist" @@ -82,7 +81,7 @@ func BuildpackNew(logger logging.Logger, creator BuildpackCreator) *cobra.Comman }), } - cmd.Flags().StringVarP(&flags.API, "api", "a", build.SupportedPlatformAPIVersions.Latest().String(), "Buildpack API compatibility of the generated buildpack") + cmd.Flags().StringVarP(&flags.API, "api", "a", "0.5", "Buildpack API compatibility of the generated buildpack") cmd.Flags().StringVarP(&flags.Path, "path", "p", "", "Path to generate the buildpack") cmd.Flags().StringVarP(&flags.Version, "version", "V", "1.0.0", "Version of the generated buildpack") cmd.Flags().StringSliceVarP(&flags.Stacks, "stacks", "s", []string{"io.buildpacks.stacks.bionic"}, "Stack(s) this buildpack will be compatible with"+multiValueHelp("stack")) diff --git a/internal/commands/buildpack_new_test.go b/internal/commands/buildpack_new_test.go index cb9ab38b7..218cba9b4 100644 --- a/internal/commands/buildpack_new_test.go +++ b/internal/commands/buildpack_new_test.go @@ -57,7 +57,7 @@ func testBuildpackNewCommand(t *testing.T, when spec.G, it spec.S) { when("BuildpackNew#Execute", func() { it("uses the args to generate artifacts", func() { mockClient.EXPECT().NewBuildpack(gomock.Any(), client.NewBuildpackOptions{ - API: "0.6", + API: "0.5", ID: "example/some-cnb", Path: filepath.Join(tmpDir, "some-cnb"), Version: "1.0.0",