Skip to content

Commit

Permalink
suppress buildpack deprecation warning
Browse files Browse the repository at this point in the history
[#157817501]

Signed-off-by: An Yu <anyu@pivotal.io>
  • Loading branch information
axyzhao authored and anyu committed May 25, 2018
1 parent 59ae5b3 commit a400097
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
10 changes: 5 additions & 5 deletions actor/pushaction/read_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ func (actor *Actor) ReadManifest(pathToManifest string, pathsToVarsFiles []strin
}

func (*Actor) checkForBuildpack(manifestApp []manifest.Application) Warnings {
for _, app := range manifestApp {
if app.Buildpack.IsSet {
return Warnings{"Deprecation warning: Use of buildpack attribute in manifest is deprecated in favor of 'buildpacks'. Please see http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future."}
}
}
// for _, app := range manifestApp {
// if app.Buildpack.IsSet {
// return Warnings{"Deprecation warning: Use of buildpack attribute in manifest is deprecated in favor of 'buildpacks'. Please see http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future."}
// }
// }

return nil
}
9 changes: 3 additions & 6 deletions actor/pushaction/read_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var _ = Describe("ReadManifest", func() {
varsKV []template.VarKV

apps []manifest.Application
warnings Warnings
executeErr error
)

Expand All @@ -50,7 +49,7 @@ var _ = Describe("ReadManifest", func() {
})

JustBeforeEach(func() {
apps, warnings, executeErr = actor.ReadManifest(manifestPath, varsFilesPaths, varsKV)
apps, _, executeErr = actor.ReadManifest(manifestPath, varsFilesPaths, varsKV)
})

Context("when provided `buildpack`", func() {
Expand All @@ -63,11 +62,10 @@ applications:
- name: some-other-app
buildpack: some-other-buildpack
`)

Expect(ioutil.WriteFile(manifestPath, manifest, 0666)).To(Succeed())
})

It("sets the buildpack on the app and returns a deprecated field warning", func() {
It("sets the buildpack on the app", func() {
Expect(executeErr).ToNot(HaveOccurred())

Expect(apps).To(ConsistOf(manifest.Application{
Expand All @@ -77,8 +75,7 @@ applications:
Name: "some-other-app",
Buildpack: types.FilteredString{Value: "some-other-buildpack", IsSet: true},
}))

Expect(warnings).To(ConsistOf(`Deprecation warning: Use of buildpack attribute in manifest is deprecated in favor of 'buildpacks'. Please see http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future.`))
// Expect(warnings).To(ConsistOf(`Deprecation warning: Use of buildpack attribute in manifest is deprecated in favor of 'buildpacks'. Please see http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future.`))
})
})
})
4 changes: 2 additions & 2 deletions integration/push/buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ var _ = Describe("push with different buildpack values", func() {
})

Context("when buildpack is provided via manifest", func() {
It("sets buildpack and returns a warning", func() {
It("sets buildpack", func() {
helpers.WithHelloWorldApp(func(dir string) {
helpers.WriteManifest(filepath.Join(dir, "manifest.yml"), map[string]interface{}{
"applications": []map[string]interface{}{
Expand All @@ -203,7 +203,7 @@ var _ = Describe("push with different buildpack values", func() {
})
session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: dir}, PushCommandName, appName, "no-start")
Eventually(session).Should(Say(`\s+buildpack:\s+staticfile_buildpack`))
Eventually(session.Err).Should(Say(`Deprecation warning: Use of buildpack`))
// Eventually(session.Err).Should(Say(`Deprecation warning: Use of buildpack`))
Eventually(session).Should(Exit(0))
})
})
Expand Down

0 comments on commit a400097

Please sign in to comment.