Fields containers, bundle, web are optional But one of them must exists. Found this discussion on stack overflow but it appears to be more than 3.5 years old. Wondering if there are any new/better way of going at it.
You could us the library mentioned in your StackOverflow link to unmarshal your yaml and then do whatever checking you want with it:
var myConfig AutoGenerated
err := yaml.Unmarshal(myYaml, &myConfig)
if err != nil {
panic(err)
}
// Do whatever checking you want
fmt.Println(myConfig.Artifacts.Containers[0].Name, "Is a valid config option for container name")
That’s obviously contrived and not very safe. But it should get you started. You can run this example on the playground and edit it to actually satisfy your requirements.
@skillian@Dean_Davidson …
Mean while I was going through compose-go and kubeval. It looks like they are reading Yaml and converting to JSON and then using JSON Validator.