1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 15:06:23 +00:00

Remove user addons when not present

This commit is contained in:
Sebastiaan van Steenis
2020-03-20 20:33:10 +01:00
parent 591088c681
commit d91e7efd2d
3 changed files with 31 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/rancher/rke/k8s"
"github.com/rancher/rke/templates"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -25,7 +26,9 @@ func getAddonJob(addonName, nodeName, image string, isDelete bool) (string, erro
"Image": image,
"DeleteJob": strconv.FormatBool(isDelete),
}
return templates.CompileTemplateFromMap(templates.AddonJobTemplate, jobConfig)
template, err := templates.CompileTemplateFromMap(templates.AddonJobTemplate, jobConfig)
logrus.Tracef("template for [%s] is: [%s]", addonName, template)
return template, err
}
func AddonJobExists(addonJobName, kubeConfigPath string, k8sWrapTransport transport.WrapperFunc) (bool, error) {