Skip to content

Commit b9d84c8

Browse files
committed
Correct contribute function to be able to contribute node to both cache and launch layer.
[#160540838]
1 parent fc9cdba commit b9d84c8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

internal/build/build.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var environment = map[string]string{
5656

5757
func (n Node) Contribute() error {
5858
if n.buildContribution {
59-
return n.cacheLayer.Contribute(func(artifact string, layer libjavabuildpack.DependencyCacheLayer) error {
59+
err := n.cacheLayer.Contribute(func(artifact string, layer libjavabuildpack.DependencyCacheLayer) error {
6060
layer.Logger.SubsequentLine("Expanding to %s", layer.Root)
6161
if err := libjavabuildpack.ExtractTarGz(artifact, layer.Root, 1); err != nil {
6262
return err
@@ -72,10 +72,13 @@ func (n Node) Contribute() error {
7272

7373
return nil
7474
})
75+
if err != nil {
76+
return err
77+
}
7578
}
7679

7780
if n.launchContribution {
78-
return n.launchLayer.Contribute(func(artifact string, layer libjavabuildpack.DependencyLaunchLayer) error {
81+
err := n.launchLayer.Contribute(func(artifact string, layer libjavabuildpack.DependencyLaunchLayer) error {
7982
layer.Logger.SubsequentLine("Expanding to %s", layer.Root)
8083
if err := libjavabuildpack.ExtractTarGz(artifact, layer.Root, 1); err != nil {
8184
return err
@@ -91,6 +94,9 @@ func (n Node) Contribute() error {
9194

9295
return nil
9396
})
97+
if err != nil {
98+
return err
99+
}
94100
}
95101
return nil
96102
}

0 commit comments

Comments
 (0)