Skip to content

Commit 2f2d201

Browse files
authored
Correctly forward runfiles environment (#218)
1 parent ec0acf9 commit 2f2d201

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

helm/private/registrar/registrar.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/abrisco/rules_helm/helm/private/helm_utils"
14+
"github.com/bazelbuild/rules_go/go/runfiles"
1415
)
1516

1617
// Chart represents the structure of Chart.yaml
@@ -133,11 +134,17 @@ func main() {
133134
log.Printf("WARNING: A Helm registry password was set but no associated `HELM_REGISTRY_USERNAME` var was found. Skipping `helm registry login`.")
134135
}
135136

137+
r, err := runfiles.New()
138+
if err != nil {
139+
log.Fatalf("Unable to create runfiles.")
140+
}
141+
136142
// Subprocess image pushers
137143
for _, pusher := range imagePushers {
138144
cmd := exec.Command(pusher)
139145
cmd.Stdout = os.Stdout
140146
cmd.Stderr = os.Stderr
147+
cmd.Env = r.Env()
141148

142149
log.Printf("Running image pusher: %s", pusher)
143150
if err := cmd.Run(); err != nil {

0 commit comments

Comments
 (0)