Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Minimize use of override
Browse files Browse the repository at this point in the history
Use of override means that under no circumstances, both debugging and
experimentation, can a user change the opinions of the buildpack.  This is
generally a bad idea and should be used sparingly.  This change updates the
code to use default instead.

Signed-off-by: Ben Hale <[email protected]>
  • Loading branch information
nebhale committed Aug 19, 2020
1 parent 00e4564 commit 2f80e31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (f Function) Contribute(layer libcnb.Layer) (libcnb.Layer, error) {
f.LayerContributor.Logger = f.Logger

return f.LayerContributor.Contribute(layer, func() (libcnb.Layer, error) {
layer.LaunchEnvironment.Override("FUNCTION_URI", f.Path)
layer.LaunchEnvironment.Default("FUNCTION_URI", f.Path)

layer.Launch = true
return layer, nil
Expand Down
2 changes: 1 addition & 1 deletion node/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func testFunction(t *testing.T, context spec.G, it spec.S) {
Expect(err).NotTo(HaveOccurred())

Expect(layer.Launch).To(BeTrue())
Expect(layer.LaunchEnvironment["FUNCTION_URI.override"]).To(Equal(filepath.Join(ctx.Application.Path, "test-artifact.js")))
Expect(layer.LaunchEnvironment["FUNCTION_URI.default"]).To(Equal(filepath.Join(ctx.Application.Path, "test-artifact.js")))
})

}

0 comments on commit 2f80e31

Please sign in to comment.