From a81f62bea49c673d0f48d45dbb6528aa6df7ceb5 Mon Sep 17 00:00:00 2001 From: Ioannis Matzaris Date: Mon, 2 Dec 2024 20:24:28 +0100 Subject: [PATCH] 202: Add PlainHTTP flag Signed-off-by: Ioannis Matzaris --- apis/release/v1beta1/types.go | 2 ++ package/crds/helm.crossplane.io_releases.yaml | 4 ++++ pkg/clients/helm/args.go | 2 ++ pkg/clients/helm/client.go | 3 +++ pkg/controller/release/release.go | 1 + 5 files changed, 12 insertions(+) diff --git a/apis/release/v1beta1/types.go b/apis/release/v1beta1/types.go index 8721287..76eb34b 100644 --- a/apis/release/v1beta1/types.go +++ b/apis/release/v1beta1/types.go @@ -93,6 +93,8 @@ type ReleaseParameters struct { SkipCRDs bool `json:"skipCRDs,omitempty"` // InsecureSkipTLSVerify skips tls certificate checks for the chart download InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"` + // PlainHTTP uses insecure HTTP connections for the chart download + PlainHTTP bool `json:"plainHTTP,omitempty"` } // ReleaseObservation are the observable fields of a Release. diff --git a/package/crds/helm.crossplane.io_releases.yaml b/package/crds/helm.crossplane.io_releases.yaml index 47a2228..d24c9d6 100644 --- a/package/crds/helm.crossplane.io_releases.yaml +++ b/package/crds/helm.crossplane.io_releases.yaml @@ -701,6 +701,10 @@ spec: type: object type: object type: array + plainHTTP: + description: PlainHTTP uses insecure HTTP connections for the + chart download + type: boolean set: items: description: SetVal represents a "set" value override in a Release diff --git a/pkg/clients/helm/args.go b/pkg/clients/helm/args.go index 6fd83b9..3ea724b 100644 --- a/pkg/clients/helm/args.go +++ b/pkg/clients/helm/args.go @@ -14,4 +14,6 @@ type Args struct { SkipCRDs bool // InsecureSkipTLSVerify skips tls certificate checks for the chart download InsecureSkipTLSVerify bool + // PlainHTTP uses HTTP connections for the chart download + PlainHTTP bool } diff --git a/pkg/clients/helm/client.go b/pkg/clients/helm/client.go index 3759453..94b19f8 100644 --- a/pkg/clients/helm/client.go +++ b/pkg/clients/helm/client.go @@ -115,6 +115,7 @@ func NewClient(log logging.Logger, restConfig *rest.Config, argAppliers ...ArgsA pc.DestDir = chartCache pc.Settings = &cli.EnvSettings{} pc.InsecureSkipTLSverify = args.InsecureSkipTLSVerify + pc.PlainHTTP = args.PlainHTTP gc := action.NewGet(actionConfig) @@ -124,12 +125,14 @@ func NewClient(log logging.Logger, restConfig *rest.Config, argAppliers ...ArgsA ic.Timeout = args.Timeout ic.SkipCRDs = args.SkipCRDs ic.InsecureSkipTLSverify = args.InsecureSkipTLSVerify + ic.PlainHTTP = args.PlainHTTP uc := action.NewUpgrade(actionConfig) uc.Wait = args.Wait uc.Timeout = args.Timeout uc.SkipCRDs = args.SkipCRDs uc.InsecureSkipTLSverify = args.InsecureSkipTLSVerify + uc.PlainHTTP = args.PlainHTTP uic := action.NewUninstall(actionConfig) uic.Wait = args.Wait diff --git a/pkg/controller/release/release.go b/pkg/controller/release/release.go index 50cf16e..f1c055b 100644 --- a/pkg/controller/release/release.go +++ b/pkg/controller/release/release.go @@ -139,6 +139,7 @@ func withRelease(cr *v1beta1.Release) helmClient.ArgsApplier { config.Timeout = waitTimeout(cr) config.SkipCRDs = cr.Spec.ForProvider.SkipCRDs config.InsecureSkipTLSVerify = cr.Spec.ForProvider.InsecureSkipTLSVerify + config.PlainHTTP = cr.Spec.ForProvider.PlainHTTP } }