Merge "Add kubeconfig cleanup in KubernetesApply executors"

This commit is contained in:
Zuul 2021-05-07 21:07:38 +00:00 committed by Gerrit Code Review
commit 1b74bd49f4
1 changed files with 2 additions and 1 deletions

View File

@ -158,10 +158,11 @@ func (e *KubeApplierExecutor) Status() (sts ifc.ExecutorStatus, err error) {
return sts, err
}
log.Debug("Getting kubeconfig file information from kubeconfig provider")
path, _, err := e.kubeconfig.GetFile()
path, cleanup, err := e.kubeconfig.GetFile()
if err != nil {
return sts, err
}
defer cleanup()
cf := provider.NewProvider(utils.FactoryFromKubeConfig(path, ctx))
rm, err := cf.Factory().ToRESTMapper()