1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 07:15:41 +00:00

Add command to validate configuration

This commit is contained in:
Josh Curl
2016-11-06 13:41:46 -08:00
parent 33b6145162
commit 25e5ca5e4c
7 changed files with 534 additions and 12 deletions

32
scripts/inline_schema.go Normal file
View File

@@ -0,0 +1,32 @@
package main
import (
"io/ioutil"
"os"
"text/template"
)
func main() {
t, err := template.New("schema_template").ParseFiles("./scripts/schema_template")
if err != nil {
panic(err)
}
schema, err := ioutil.ReadFile("./scripts/schema.json")
if err != nil {
panic(err)
}
inlinedFile, err := os.Create("config/schema.go")
if err != nil {
panic(err)
}
err = t.Execute(inlinedFile, map[string]string{
"schema": string(schema),
})
if err != nil {
panic(err)
}
}