Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure passwords in helm templates are quoted #96

Merged
merged 5 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/spectrocloud-labs/prompts-tui v0.0.0-20240715203051-ec46421ba5c0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/validator-labs/validator v0.0.48
github.com/validator-labs/validator v0.0.49
github.com/validator-labs/validator-plugin-aws v0.1.1
github.com/validator-labs/validator-plugin-azure v0.0.13
github.com/validator-labs/validator-plugin-network v0.0.19
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4=
github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A=
github.com/validator-labs/validator v0.0.48 h1:Vngvw9Y0B3B5ea8LqHgxBKw8dOS8ZK8z2zyzMq2rs/8=
github.com/validator-labs/validator v0.0.48/go.mod h1:YxUKAXuSR6fIAi7WCQV/Wbrzf9szf8aCTeYWEA+JyIY=
github.com/validator-labs/validator v0.0.49 h1:gqtiVFBdLHNJysGx7MDx09uYJ7aLZ5x0bHgFmN9bVhM=
github.com/validator-labs/validator v0.0.49/go.mod h1:YxUKAXuSR6fIAi7WCQV/Wbrzf9szf8aCTeYWEA+JyIY=
github.com/validator-labs/validator-plugin-aws v0.1.1 h1:GPWSk1hSRBV+NgOBKKn0q6f2iH3+ZikHYuSD6S41Ybk=
github.com/validator-labs/validator-plugin-aws v0.1.1/go.mod h1:GGFVx01t77XomgrPZFmF5Dkre+iqmtBOBjThuWgB/jI=
github.com/validator-labs/validator-plugin-azure v0.0.13 h1:0aWcNuOs9XHQg6TFyW+TM69A3FxUOzG/E5uQF1fn+Og=
Expand Down
3 changes: 2 additions & 1 deletion pkg/components/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
},
},
ReleaseSecret: &Secret{
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginNetwork),
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginNetwork),
BasicAuth: &BasicAuth{},

Check warning on line 34 in pkg/components/network.go

View check run for this annotation

Codecov / codecov/patch

pkg/components/network.go#L33-L34

Added lines #L33 - L34 were not covered by tests
},
Validator: &network_api.NetworkValidatorSpec{
IPRangeRules: config.IPRangeRules,
Expand Down
3 changes: 2 additions & 1 deletion pkg/components/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
},
},
ReleaseSecret: &Secret{
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginOci),
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginOci),
BasicAuth: &BasicAuth{},

Check warning on line 33 in pkg/components/oci.go

View check run for this annotation

Codecov / codecov/patch

pkg/components/oci.go#L32-L33

Added lines #L32 - L33 were not covered by tests
},
Validator: &oci_api.OciValidatorSpec{
OciRegistryRules: generateOciRegistryRules(config.HostRefs),
Expand Down
2 changes: 2 additions & 0 deletions pkg/components/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,12 @@
}
vc.KindConfig.UseKindCluster = true
vc.Kubeconfig = kubeconfig
// TODO: update this to use the correct image registry (custom private registry / hauler / default)
vc.ImageRegistry = cfg.ValidatorImagePath()
vc.ProxyConfig = &ProxyConfig{
Env: &Env{
PodCIDR: &cfg.DefaultPodCIDR,
ProxyCACert: &CACert{},

Check warning on line 666 in pkg/components/validator.go

View check run for this annotation

Codecov / codecov/patch

pkg/components/validator.go#L666

Added line #L666 was not covered by tests
ServiceIPRange: &cfg.DefaultServiceIPRange,
},
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/components/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
},
},
ReleaseSecret: &Secret{
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginVsphere),
Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginVsphere),
BasicAuth: &BasicAuth{},

Check warning on line 41 in pkg/components/vsphere.go

View check run for this annotation

Codecov / codecov/patch

pkg/components/vsphere.go#L40-L41

Added lines #L40 - L41 were not covered by tests
},
Account: &vsphere.CloudAccount{
Insecure: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package config

// ValidatorChartVersions is a map of validator component names to their respective versions
var ValidatorChartVersions = map[string]string{
Validator: "v0.0.48",
Validator: "v0.0.49",
ValidatorPluginAws: "v0.1.1",
ValidatorPluginAzure: "v0.0.13",
ValidatorPluginNetwork: "v0.0.19",
Expand Down
12 changes: 6 additions & 6 deletions pkg/utils/embed/resources/validator/validator-base-values.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ pluginSecrets:
{{- if .VspherePlugin.Validator.Auth.SecretName }}
vSphere:
secretName: {{ .VspherePlugin.Validator.Auth.SecretName }}
username: {{ .VspherePlugin.Account.Username }}
password: {{ .VspherePlugin.Account.Password }}
vcenterServer: {{ .VspherePlugin.Account.VcenterServer }}
insecureSkipVerify: {{ .VspherePlugin.Account.Insecure }}
username: {{ .VspherePlugin.Account.Username | quote }}
password: {{ .VspherePlugin.Account.Password | quote }}
vcenterServer: {{ .VspherePlugin.Account.VcenterServer | quote }}
insecureSkipVerify: {{ .VspherePlugin.Account.Insecure | quote }}
{{- else }}
vSphere: {}
{{- end }}
Expand All @@ -142,8 +142,8 @@ pluginSecrets:
- secretName: {{ .Name }}
env:
{{- if .BasicAuth }}
username: {{ .BasicAuth.Username }}
password: {{ .BasicAuth.Password }}
username: {{ .BasicAuth.Username | quote }}
password: {{ .BasicAuth.Password | quote }}
{{- end }}
{{- range $k, $v := .Data }}
{{ $k }}: {{ $v }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ helmRelease:
chart:
name: validator
repository: https://validator-labs.github.io/validator
version: v0.0.48
version: v0.0.49
insecureSkipVerify: true
values: ""
helmReleaseSecret:
Expand Down