Skip to content

Commit

Permalink
Fix spelling of clientPlatform
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <[email protected]>
  • Loading branch information
carolynvs committed Sep 13, 2022
1 parent a44d7aa commit 4df8718
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions pkg/helm3/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ type BuildInput struct {
// mixins:
// - helm3:
// clientVersion: v3.8.2
// clientPlatfrom: linux
// clientPlatform: linux
// clientArchitecture: amd64 | arm64 | arm | i386
// repositories:
// stable:
// url: "https://charts.helm.sh/stable"

type MixinConfig struct {
ClientVersion string `yaml:"clientVersion,omitempty"`
ClientPlatfrom string `yaml:"clientPlatfrom,omitempty"`
ClientArchitecture string `yaml:"clientArchitecture,omitempty"`
Repositories map[string]Repository
ClientPlatform string `yaml:"clientPlatform,omitempty"`
}

type Repository struct {
Expand Down Expand Up @@ -69,8 +69,8 @@ func (m *Mixin) Build(ctx context.Context) error {
m.HelmClientVersion = suppliedClientVersion
}

if input.Config.ClientPlatfrom != "" {
m.HelmClientPlatfrom = input.Config.ClientPlatfrom
if input.Config.ClientPlatform != "" {
m.HelmClientPlatform = input.Config.ClientPlatform
}

if input.Config.ClientArchitecture != "" {
Expand All @@ -80,7 +80,7 @@ func (m *Mixin) Build(ctx context.Context) error {
fmt.Fprint(m.Out, "ENV HELM_EXPERIMENTAL_OCI=1")
fmt.Fprintf(m.Out, "\nRUN apt-get update && apt-get install -y curl")
fmt.Fprintf(m.Out, "\nRUN curl https://get.helm.sh/helm-%s-%s-%s.tar.gz --output helm3.tar.gz",
m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture)
m.HelmClientVersion, m.HelmClientPlatform, m.HelmClientArchitecture)
fmt.Fprintf(m.Out, "\nRUN tar -xvf helm3.tar.gz && rm helm3.tar.gz")
fmt.Fprintf(m.Out, "\nRUN mv linux-amd64/helm /usr/local/bin/helm3")
fmt.Fprintf(m.Out, "\nRUN curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.22.1/bin/linux/amd64/kubectl &&\\")
Expand Down
8 changes: 4 additions & 4 deletions pkg/helm3/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1
err = m.Build(ctx)
require.NoError(t, err, "build failed")

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

wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture) +
wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatform, m.HelmClientArchitecture) +
`USER ${BUNDLE_USER}
RUN helm3 repo add harbor https://helm.getharbor.io
RUN helm3 repo add jetstack https://charts.jetstack.io
Expand All @@ -81,7 +81,7 @@ USER root

err = m.Build(ctx)
require.NoError(t, err, "build failed")
wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture) +
wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatform, m.HelmClientArchitecture) +
`USER ${BUNDLE_USER}
RUN helm3 repo update
USER root
Expand All @@ -100,7 +100,7 @@ USER root
m.In = bytes.NewReader(b)
err = m.Build(ctx)
require.NoError(t, err, "build failed")
wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatfrom, m.HelmClientArchitecture)
wantOutput := fmt.Sprintf(buildOutput, m.HelmClientVersion, m.HelmClientPlatform, m.HelmClientArchitecture)
gotOutput := m.TestContext.GetOutput()
assert.Equal(t, wantOutput, gotOutput)
})
Expand Down
6 changes: 3 additions & 3 deletions pkg/helm3/helm3.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
)

const defaultClientVersion string = "v3.8.2"
const defaultClientPlatfrom string = "linux"
const defaultClientPlatform string = "linux"
const defaultClientArchitecture string = "amd64"

// Helm is the logic behind the helm mixin
type Mixin struct {
runtime.RuntimeConfig
ClientFactory kubernetes.ClientFactory
HelmClientVersion string
HelmClientPlatfrom string
HelmClientPlatform string
HelmClientArchitecture string
}

Expand All @@ -32,7 +32,7 @@ func New() *Mixin {
RuntimeConfig: runtime.NewConfig(),
ClientFactory: kubernetes.New(),
HelmClientVersion: defaultClientVersion,
HelmClientPlatfrom: defaultClientPlatfrom,
HelmClientPlatform: defaultClientPlatform,
HelmClientArchitecture: defaultClientArchitecture,
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/helm3/testdata/build-input-with-version.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config:
clientVersion: v3.8.2
clientPlatfrom: linux
clientPlatform: linux
clientArchitecture: amd64

install:
Expand Down

0 comments on commit 4df8718

Please sign in to comment.