From 1965059eaf8cf9963f3e2abe4b352d24921fd2e7 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Tue, 23 Jul 2024 15:18:17 -0700 Subject: [PATCH 1/5] fix: fix plugin configuration functions --- pkg/components/network.go | 3 ++- pkg/components/oci.go | 3 ++- pkg/components/validator.go | 3 ++- pkg/components/vsphere.go | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/components/network.go b/pkg/components/network.go index 642cbc00..0fd02678 100644 --- a/pkg/components/network.go +++ b/pkg/components/network.go @@ -30,7 +30,8 @@ func ConfigureNetworkPlugin(vc *ValidatorConfig, config NetworkConfig) { }, }, ReleaseSecret: &Secret{ - Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginNetwork), + Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginNetwork), + BasicAuth: &BasicAuth{}, }, Validator: &network_api.NetworkValidatorSpec{ IPRangeRules: config.IPRangeRules, diff --git a/pkg/components/oci.go b/pkg/components/oci.go index 7b21c0c1..7531daf1 100644 --- a/pkg/components/oci.go +++ b/pkg/components/oci.go @@ -29,7 +29,8 @@ func ConfigureOciPlugin(vc *ValidatorConfig, config OciConfig) { }, }, ReleaseSecret: &Secret{ - Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginOci), + Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginOci), + BasicAuth: &BasicAuth{}, }, Validator: &oci_api.OciValidatorSpec{ OciRegistryRules: generateOciRegistryRules(config.HostRefs), diff --git a/pkg/components/validator.go b/pkg/components/validator.go index fbfafbd7..237967cb 100644 --- a/pkg/components/validator.go +++ b/pkg/components/validator.go @@ -658,10 +658,11 @@ func ConfigureBaseValidator(vc *ValidatorConfig, kubeconfig string) { } vc.KindConfig.UseKindCluster = true vc.Kubeconfig = kubeconfig - vc.ImageRegistry = cfg.ValidatorImagePath() + vc.ImageRegistry = cfg.ValidatorImagePath() // TODO: this should check if RegistryConfig is enabled and if so return the registry path vc.ProxyConfig = &ProxyConfig{ Env: &Env{ PodCIDR: &cfg.DefaultPodCIDR, + ProxyCACert: &CACert{}, ServiceIPRange: &cfg.DefaultServiceIPRange, }, } diff --git a/pkg/components/vsphere.go b/pkg/components/vsphere.go index 21a251a6..7dc03fe8 100644 --- a/pkg/components/vsphere.go +++ b/pkg/components/vsphere.go @@ -37,7 +37,8 @@ func ConfigureVspherePlugin(vc *ValidatorConfig, config VsphereConfig) { }, }, ReleaseSecret: &Secret{ - Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginVsphere), + Name: fmt.Sprintf("validator-helm-release-%s", cfg.ValidatorPluginVsphere), + BasicAuth: &BasicAuth{}, }, Account: &vsphere.CloudAccount{ Insecure: true, From 0a3faf97ca8e3c7eee38d75f1ba6f83416d83cc0 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Tue, 23 Jul 2024 16:33:11 -0700 Subject: [PATCH 2/5] fix: ensure vsphere password is quoted --- .../resources/validator/validator-base-values.tmpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/utils/embed/resources/validator/validator-base-values.tmpl b/pkg/utils/embed/resources/validator/validator-base-values.tmpl index 18dd4eef..6d2851ac 100644 --- a/pkg/utils/embed/resources/validator/validator-base-values.tmpl +++ b/pkg/utils/embed/resources/validator/validator-base-values.tmpl @@ -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 }} @@ -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 }} From 671865d48b915630172470331a6b36f2a452cb35 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Tue, 23 Jul 2024 17:14:27 -0700 Subject: [PATCH 3/5] chore: bump validator version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index aa99af1f..05f8d606 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index bc636705..5dcf0c4f 100644 --- a/go.sum +++ b/go.sum @@ -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= From 68cc4676e8a7e82ee9a3dfa2fe172d32eaf6e025 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Tue, 23 Jul 2024 17:17:24 -0700 Subject: [PATCH 4/5] chore: update TODO --- pkg/components/validator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/components/validator.go b/pkg/components/validator.go index 237967cb..a02c8046 100644 --- a/pkg/components/validator.go +++ b/pkg/components/validator.go @@ -658,7 +658,8 @@ func ConfigureBaseValidator(vc *ValidatorConfig, kubeconfig string) { } vc.KindConfig.UseKindCluster = true vc.Kubeconfig = kubeconfig - vc.ImageRegistry = cfg.ValidatorImagePath() // TODO: this should check if RegistryConfig is enabled and if so return the registry path + // 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, From 341eaee874ebe73266854eab6a8df47a30203167 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Tue, 23 Jul 2024 17:25:02 -0700 Subject: [PATCH 5/5] chore: make reviewable --- pkg/config/versions.go | 2 +- tests/integration/_validator/testcases/data/validator.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/versions.go b/pkg/config/versions.go index ab1e662d..5021d998 100644 --- a/pkg/config/versions.go +++ b/pkg/config/versions.go @@ -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", diff --git a/tests/integration/_validator/testcases/data/validator.yaml b/tests/integration/_validator/testcases/data/validator.yaml index 56d39b27..9e0f5b8f 100644 --- a/tests/integration/_validator/testcases/data/validator.yaml +++ b/tests/integration/_validator/testcases/data/validator.yaml @@ -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: