Skip to content

Commit

Permalink
Pass-through PROXY environment to Replicated SDK deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin committed Sep 4, 2024
1 parent 0cc081e commit 1fc54f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/rewrite/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func Rewrite(rewriteOptions RewriteOptions) error {
IsAirgap: rewriteOptions.IsAirgap,
KotsadmID: k8sutil.GetKotsadmID(clientset),
AppID: rewriteOptions.AppID,
HTTPProxyEnvValue: rewriteOptions.HTTPProxyEnvValue,
HTTPSProxyEnvValue: rewriteOptions.HTTPSProxyEnvValue,
NoProxyEnvValue: rewriteOptions.NoProxyEnvValue,
}
if err = upstream.WriteUpstream(u, writeUpstreamOptions); err != nil {
log.FinishSpinnerWithError()
Expand Down
18 changes: 18 additions & 0 deletions pkg/upstream/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,24 @@ func buildReplicatedValues(u *types.Upstream, options types.WriteOptions) (map[s
replicatedValues["license"] = string(MustMarshalLicense(u.License))
}

replicatedValues["extraEnv"] = []struct {
Name string `yaml:"name"`
Value string `yaml:"value"`
}{
{
Name: "HTTP_PROXY",
Value: options.HTTPProxyEnvValue,
},
{
Name: "HTTPS_PROXY",
Value: options.HTTPSProxyEnvValue,
},
{
Name: "NO_PROXY",
Value: options.NoProxyEnvValue,
},
}

return replicatedValues, nil
}

Expand Down

0 comments on commit 1fc54f8

Please sign in to comment.