diff --git a/build.go b/build.go index 4682808..3084a8e 100644 --- a/build.go +++ b/build.go @@ -166,8 +166,8 @@ func Build(builder Builder, options ...Option) { logger.Debugf("Buildpack: %+v", ctx.Buildpack) API := strings.TrimSpace(ctx.Buildpack.API) - if API != "0.5" && API != "0.6" { - config.exitHandler.Error(errors.New("this version of libcnb is only compatible with buildpack APIs 0.5 and 0.6")) + if API != "0.5" && API != "0.6" && API != "0.7" { + config.exitHandler.Error(errors.New("this version of libcnb is only compatible with buildpack APIs 0.5, 0.6, and 0.7")) return } diff --git a/build_test.go b/build_test.go index aeb9da3..d079f1a 100644 --- a/build_test.go +++ b/build_test.go @@ -181,7 +181,7 @@ test-key = "test-value" Expect(os.RemoveAll(platformPath)).To(Succeed()) }) - context("buildpack API is not 0.5 or 0.6", func() { + context("buildpack API is not 0.5, 0.6, or 0.7", func() { it.Before(func() { Expect(ioutil.WriteFile(filepath.Join(buildpackPath, "buildpack.toml"), []byte(` @@ -203,7 +203,7 @@ version = "1.1.1" ) Expect(exitHandler.Calls[0].Arguments.Get(0)).To(MatchError( - "this version of libcnb is only compatible with buildpack APIs 0.5 and 0.6", + "this version of libcnb is only compatible with buildpack APIs 0.5, 0.6, and 0.7", )) }) }) diff --git a/detect.go b/detect.go index aa6696b..e2800b8 100644 --- a/detect.go +++ b/detect.go @@ -116,8 +116,8 @@ func Detect(detector Detector, options ...Option) { logger.Debugf("Buildpack: %+v", ctx.Buildpack) API := strings.TrimSpace(ctx.Buildpack.API) - if API != "0.5" && API != "0.6" { - config.exitHandler.Error(errors.New("this version of libcnb is only compatible with buildpack API 0.5 and 0.6")) + if API != "0.5" && API != "0.6" && API != "0.7" { + config.exitHandler.Error(errors.New("this version of libcnb is only compatible with buildpack APIs 0.5, 0.6, and 0.7")) return } diff --git a/detect_test.go b/detect_test.go index 805ad35..c4c6762 100644 --- a/detect_test.go +++ b/detect_test.go @@ -135,7 +135,7 @@ test-key = "test-value" Expect(os.RemoveAll(platformPath)).To(Succeed()) }) - context("buildpack API is not 0.5 or 0.6", func() { + context("buildpack API is not 0.5, 0.6, or 0.7", func() { it.Before(func() { Expect(ioutil.WriteFile(filepath.Join(buildpackPath, "buildpack.toml"), []byte(` @@ -157,7 +157,7 @@ version = "1.1.1" ) Expect(exitHandler.Calls[0].Arguments.Get(0)).To(MatchError( - "this version of libcnb is only compatible with buildpack API 0.5 and 0.6", + "this version of libcnb is only compatible with buildpack APIs 0.5, 0.6, and 0.7", )) }) })