Improve explanatory comment about client creation

Signed-off-by: Simon Alling <alling.simon@gmail.com>
pull/9677/head
Simon Alling 4 years ago
parent ad1a8a7d8d
commit 75b2cf4b04

@ -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")

Loading…
Cancel
Save