helm: fix log formatting (#2905)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2024-02-14 08:52:46 +01:00 committed by GitHub
parent 6829c27178
commit f9442cecb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,7 @@ type applyAction interface {
func newActionConfig(kubeConfig []byte, logger debugLog) (*action.Configuration, error) {
actionConfig := &action.Configuration{}
if err := actionConfig.Init(&clientGetter{kubeConfig: kubeConfig}, constants.HelmNamespace,
"secret", logger.Debug); err != nil {
"secret", helmLog(logger)); err != nil {
return nil, err
}
return actionConfig, nil
@ -222,3 +222,9 @@ func (c *clientGetter) ToRESTMapper() (meta.RESTMapper, error) {
func (c *clientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig {
return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(&clientcmd.ClientConfigLoadingRules{}, &clientcmd.ConfigOverrides{})
}
func helmLog(log debugLog) action.DebugLog {
return func(format string, v ...interface{}) {
log.Debug(fmt.Sprintf(format, v...))
}
}