From 75b2cf4b04b12ead1235c6b19dc8d5be36b02774 Mon Sep 17 00:00:00 2001 From: Simon Alling Date: Wed, 1 Dec 2021 17:27:26 +0100 Subject: [PATCH] Improve explanatory comment about client creation Signed-off-by: Simon Alling --- pkg/action/hooks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/action/hooks.go b/pkg/action/hooks.go index 3d864e651..22b69b191 100644 --- a/pkg/action/hooks.go +++ b/pkg/action/hooks.go @@ -88,7 +88,7 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent, h.LastRun.CompletedAt = helmtime.Now() if isTestHook(h) { - // "Why create a new client for each hook?" Because `cfg` can be `nil` outside the `for` loop. + // "Why create a new client for each hook?" Because `cfg.RESTClientGetter` can be `nil` before the `for` loop, as detected by the `TestInstall/basic_install` and `TestInstallRelease` tests. client, err := cfg.KubernetesClientSet() if err != nil { return errors.Wrapf(err, "unable to create Kubernetes client set to fetch pod logs")