dir2config: add version
This commit is contained in:
parent
40d08139db
commit
12dcca32f7
@ -16,6 +16,8 @@ import (
|
|||||||
"novit.tech/direktil/local-server/pkg/clustersconfig"
|
"novit.tech/direktil/local-server/pkg/clustersconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var Version = "dev"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Debug = false
|
Debug = false
|
||||||
|
|
||||||
|
@ -185,6 +185,8 @@ func (ctx *renderContext) renderConfigTo(buf io.Writer, configTemplate *clusters
|
|||||||
return hex.EncodeToString(ba[:])
|
return hex.EncodeToString(ba[:])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extraFuncs["version"] = func() string { return Version }
|
||||||
|
|
||||||
if err := configTemplate.Execute(ctxName, "config", buf, ctxMap, extraFuncs); err != nil {
|
if err := configTemplate.Execute(ctxName, "config", buf, ctxMap, extraFuncs); err != nil {
|
||||||
log.Fatalf("failed to render config %q for host %q: %v", ctx.Host.Config, ctx.Host.Name, err)
|
log.Fatalf("failed to render config %q for host %q: %v", ctx.Host.Config, ctx.Host.Name, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user