diff --git a/api/integreatly/v1alpha1/grafana_types.go b/api/integreatly/v1alpha1/grafana_types.go index 591e5ae33..cc23eaee6 100644 --- a/api/integreatly/v1alpha1/grafana_types.go +++ b/api/integreatly/v1alpha1/grafana_types.go @@ -123,8 +123,9 @@ type GrafanaDeployment struct { // GrafanaHttpProxy provides a means to configure the Grafana deployment // to use an HTTP(S) proxy when making requests and resolving plugins. type GrafanaHttpProxy struct { - Enabled bool `json:"enabled"` - URL string `json:"url,omitempty"` + Enabled bool `json:"enabled"` + URL string `json:"url,omitempty"` + SecureURL string `json:"secureUrl,omitempty"` } // GrafanaIngress provides a means to configure the ingress created diff --git a/controllers/model/grafanaDeployment.go b/controllers/model/grafanaDeployment.go index 184e20974..49bcb1842 100644 --- a/controllers/model/grafanaDeployment.go +++ b/controllers/model/grafanaDeployment.go @@ -552,6 +552,12 @@ func getContainers(cr *v1alpha1.Grafana, configHash, dsHash string) []v13.Contai Name: "HTTP_PROXY", Value: cr.Spec.Deployment.HttpProxy.URL, }) + if cr.Spec.Deployment.HttpProxy.SecureURL != "" { + envVars = append(envVars, v13.EnvVar{ + Name: "HTTPS_PROXY", + Value: cr.Spec.Deployment.HttpProxy.SecureURL, + }) + } } if cr.Spec.Deployment != nil && cr.Spec.Deployment.Env != nil { @@ -642,6 +648,12 @@ func getInitContainers(cr *v1alpha1.Grafana, plugins string) []v13.Container { Name: "HTTP_PROXY", Value: cr.Spec.Deployment.HttpProxy.URL, }) + if cr.Spec.Deployment.HttpProxy.SecureURL != "" { + envVars = append(envVars, v13.EnvVar{ + Name: "HTTPS_PROXY", + Value: cr.Spec.Deployment.HttpProxy.SecureURL, + }) + } } var volumeName = constants.GrafanaPluginsVolumeName