1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-02 15:34:36 +00:00

rancher pass serviceoptions and addon templates to rke

This commit is contained in:
kinarashah
2019-06-17 13:52:15 -07:00
committed by Alena Prokharchyk
parent c191ed6202
commit 116b47b025
14 changed files with 127 additions and 101 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"text/template"
"github.com/rancher/norman/types/convert"
"github.com/rancher/rke/metadata"
"github.com/rancher/rke/util"
@@ -19,8 +20,10 @@ func CompileTemplateFromMap(tmplt string, configMap interface{}) (string, error)
return out.String(), nil
}
func GetVersionedTemplates(templateName string, k8sVersion string) string {
func GetVersionedTemplates(templateName string, data map[string]interface{}, k8sVersion string) string {
if template, ok := data[templateName]; ok {
return convert.ToString(template)
}
versionedTemplate := metadata.K8sVersionToTemplates[templateName]
if t, ok := versionedTemplate[util.GetTagMajorVersion(k8sVersion)]; ok {
return t