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:
32
scripts/inline_schema.go
Normal file
32
scripts/inline_schema.go
Normal 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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user