Last active
February 26, 2024 16:39
-
-
Save fl64/b204f00df9eb4d9f709fe80d34534d55 to your computer and use it in GitHub Desktop.
validate cloud provider spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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