Skip to content

Commit

Permalink
Use BUNDLE_USER instead of UID
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Mar 2, 2022
1 parent def6f71 commit 864f450
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/helm3/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (m *Mixin) Build() error {
fmt.Fprintf(m.Out, "\n mv kubectl /usr/local/bin && chmod a+x /usr/local/bin/kubectl\n")
if len(input.Config.Repositories) > 0 {
// Switch to a non-root user so helm is configured for the user the container will execute as
fmt.Fprintln(m.Out, "USER ${UID}")
fmt.Fprintln(m.Out, "USER ${BUNDLE_USER}")

// Go through repositories
names := make([]string, 0, len(input.Config.Repositories))
Expand Down
6 changes: 3 additions & 3 deletions pkg/helm3/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1
require.NoError(t, err, "build failed")

wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture) +
`USER ${UID}
`USER ${BUNDLE_USER}
RUN helm3 repo add stable kubernetes-charts
RUN helm3 repo update
USER root
Expand All @@ -58,7 +58,7 @@ USER root
require.NoError(t, err, "build failed")

wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture) +
`USER ${UID}
`USER ${BUNDLE_USER}
RUN helm3 repo add harbor https://helm.getharbor.io
RUN helm3 repo add jetstack https://charts.jetstack.io
RUN helm3 repo add stable kubernetes-charts
Expand All @@ -80,7 +80,7 @@ USER root
err = m.Build()
require.NoError(t, err, "build failed")
wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture) +
`USER ${UID}
`USER ${BUNDLE_USER}
RUN helm3 repo update
USER root
`
Expand Down

0 comments on commit 864f450

Please sign in to comment.