Skip to content

Commit

Permalink
feat: add HTTPSProxy to env var
Browse files Browse the repository at this point in the history
  • Loading branch information
HVBE committed Feb 9, 2022
1 parent dcd6d7a commit 5ea9e4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/integreatly/v1alpha1/grafana_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions controllers/model/grafanaDeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ea9e4d

Please sign in to comment.