Updating api/validation/schema_test to test testapi.Version rather than just v1beta1

This commit is contained in:
nikhiljindal
2015-04-14 11:31:12 -07:00
parent 86d3072492
commit 40842e4471
14 changed files with 303 additions and 2238 deletions

View File

@@ -78,7 +78,14 @@ func main() {
if err != nil {
log.Fatalf("Couldn't read from input: %q", err)
}
isYAML := isYAML(data)
if isYAML {
data, err = yaml.YAMLToJSON(data)
if err != nil {
log.Fatalf("Failed to convert YAML to JSON: %q", err)
}
}
obj, err := api.Scheme.Decode(data)
if err != nil {
log.Fatalf("Couldn't decode input: %q", err)
@@ -89,7 +96,7 @@ func main() {
log.Fatalf("Failed to encode to version %q: %q", *outputVersion, err)
}
if isYAML(data) {
if isYAML {
outData, err = yaml.JSONToYAML(outData)
if err != nil {
log.Fatalf("Failed to convert to YAML: %q", err)