Skip to content

Commit

Permalink
Reproducible Security Providers
Browse files Browse the repository at this point in the history
Previously the list of security providers that was passed as an environment
variable to launch time was non-deterministic.  It was the result of map and
would make layers non-reproducible in some cases.  This change guarantees the
order of the environment variable contents.

Signed-off-by: Ben Hale <bhale@vmware.com>
  • Loading branch information
nebhale committed Nov 10, 2020
1 parent e92d0d5 commit fd8e420
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jre.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"

"github.com/buildpacks/libcnb"
Expand Down Expand Up @@ -133,6 +134,7 @@ func (j JRE) Contribute(layer libcnb.Layer) (libcnb.Layer, error) {
for k, v := range p.Map() {
providers = append(providers, fmt.Sprintf("%s|%s", k, v))
}
sort.Strings(providers)
layer.LaunchEnvironment.Default("BPI_JVM_SECURITY_PROVIDERS", strings.Join(providers, " "))

layer.LaunchEnvironment.Default("JAVA_HOME", layer.Path)
Expand Down

0 comments on commit fd8e420

Please sign in to comment.