Skip to content

Commit

Permalink
Merge pull request #279 from Azanul/ooc-operator-fix
Browse files Browse the repository at this point in the history
action config creation bug fix
  • Loading branch information
leecalcote authored Apr 4, 2023
2 parents 68f836b + f2920b0 commit f6cdc99
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/kubernetes/apply-helm-chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,19 @@ func checkIfInstallable(ch *chart.Chart) error {
func createHelmActionConfig(c *Client, cfg ApplyHelmChartConfig) (*action.Configuration, error) {
// Set the environment variable needed by the Init methods
os.Setenv("HELM_DRIVER_SQL_CONNECTION_STRING", cfg.SQLConnectionString)
os.Setenv("HELM_KUBEAPISERVER", c.RestConfig.Host)

// KubeConfig setup
cafile, err := setDataAndReturnFileHandler(c.RestConfig.CAData)
if err != nil {
return nil, err
}
cafilename := cafile.Name()
os.Setenv("HELM_KUBECAFILE", cafilename)

kubeConfig := genericclioptions.NewConfigFlags(false)
kubeConfig.APIServer = &c.RestConfig.Host
kubeConfig.CAFile = &cafilename
kubeConfig.BearerToken = &c.RestConfig.BearerToken

actionConfig := new(action.Configuration)
if err := actionConfig.Init(kubeConfig, cfg.Namespace, string(cfg.HelmDriver), cfg.Logger); err != nil {
return nil, ErrApplyHelmChart(err)
Expand Down

0 comments on commit f6cdc99

Please sign in to comment.