Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Alero Awani <[email protected]>
  • Loading branch information
Alero-Awani committed Dec 12, 2024
1 parent 12f4b50 commit 961a6fb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions utils/kubernetes/apply-helm-chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,22 +420,22 @@ func createHelmActionConfig(c *Client, cfg ApplyHelmChartConfig) (*action.Config

// Create temp files for client cert and key if they exist
var certfile, keyfile *os.File
var certfilename, keyfilename string
var certfilename, keyfilename string

if len(c.RestConfig.TLSClientConfig.CertData) > 0 {
certfile, err = setDataAndReturnFileHandler(c.RestConfig.TLSClientConfig.CertData)
if err != nil {
return nil, err
return nil, err
}
certfilename = certfile.Name()
}

if len(c.RestConfig.TLSClientConfig.KeyData) > 0 {
keyfile, err = setDataAndReturnFileHandler(c.RestConfig.TLSClientConfig.KeyData)
if err != nil {
return nil, err
}
keyfilename = keyfile.Name()
keyfile, err = setDataAndReturnFileHandler(c.RestConfig.TLSClientConfig.KeyData)
if err != nil {
return nil, err
}
keyfilename = keyfile.Name()
}

kubeConfig := genericclioptions.NewConfigFlags(false)
Expand All @@ -447,12 +447,12 @@ func createHelmActionConfig(c *Client, cfg ApplyHelmChartConfig) (*action.Config
kubeConfig.CertFile = &certfilename
}
if keyfilename != "" {
kubeConfig.KeyFile = &keyfilename
kubeConfig.KeyFile = &keyfilename
}

// Only set bearer token if client certs aren't being used
if certfilename == "" && len(c.RestConfig.BearerToken) > 0 {
kubeConfig.BearerToken = &c.RestConfig.BearerToken
kubeConfig.BearerToken = &c.RestConfig.BearerToken
}

actionConfig := new(action.Configuration)
Expand Down

0 comments on commit 961a6fb

Please sign in to comment.