From 62e0a145eff342abbb6c5c0c818fc153b665ae39 Mon Sep 17 00:00:00 2001 From: Ricardo Maraschini Date: Tue, 7 Apr 2020 12:10:59 +0200 Subject: [PATCH] Zeroing BearerTokenFile for prune Kubernetes client-go requires only one authentication method to be present therefore this patch zeroes the content of BearerTokenFile as basic auth is used during prune. In a nutshell: or we use token based authentication or basic auth, never both at the same time. This is a cherrypick of 966f1bb389f91503670b33263be35df346d9e568 --- pkg/cli/admin/prune/images/images.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cli/admin/prune/images/images.go b/pkg/cli/admin/prune/images/images.go index d9d1527f85..a2028d7574 100644 --- a/pkg/cli/admin/prune/images/images.go +++ b/pkg/cli/admin/prune/images/images.go @@ -834,6 +834,7 @@ func getRegistryClient(clientConfig *restclient.Config, registryCABundle string, // zero out everything we don't want to use registryClientConfig.BearerToken = "" + registryClientConfig.BearerTokenFile = "" registryClientConfig.CertFile = "" registryClientConfig.CertData = []byte{} registryClientConfig.KeyFile = ""