Skip to content

Commit

Permalink
Addons: Only template .tmpl files
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr authored and medyagh committed May 7, 2024
1 parent 3f852c8 commit b46d912
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/minikube/assets/vm_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"path"
"path/filepath"
"strconv"
"strings"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -358,12 +359,14 @@ func (m *BinAsset) loadData() error {
return err
}

tpl, err := template.New(m.SourcePath).Funcs(template.FuncMap{"default": defaultValue}).Parse(string(contents))
if err != nil {
return err
}
if strings.HasSuffix(m.BaseAsset.SourcePath, ".tmpl") {
tpl, err := template.New(m.SourcePath).Funcs(template.FuncMap{"default": defaultValue}).Parse(string(contents))
if err != nil {
return err
}

m.template = tpl
m.template = tpl
}

m.length = len(contents)
m.reader = bytes.NewReader(contents)
Expand Down

0 comments on commit b46d912

Please sign in to comment.