Skip to content

Instantly share code, notes, and snippets.

@fl64
Last active February 26, 2024 16:39
Show Gist options
  • Save fl64/b204f00df9eb4d9f709fe80d34534d55 to your computer and use it in GitHub Desktop.
Save fl64/b204f00df9eb4d9f709fe80d34534d55 to your computer and use it in GitHub Desktop.
validate cloud provider spec
package main
import (
"fmt"
"log"
"os"
dhctl "github.com/deckhouse/deckhouse/dhctl/pkg/config"
)
func main() {
var err error
newStore := dhctl.NewSchemaStore("")
err = newStore.UploadByPath("./spec.yaml")
if err != nil {
log.Fatal(err)
}
doc, err := os.ReadFile("./example.yaml")
if err != nil {
log.Fatal(err)
}
_, err = newStore.Validate(&doc)
fmt.Println(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment