You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: can we handle this better than spitting out an obtuse error?
75
+
log.Fatalf("rendering run results: %v", err)
94
76
}
95
77
96
-
validator:=config.ValidatorForConfig(*cfg)
97
-
98
-
result:=validator.Validate(oldCrd, newCrd)
99
-
err=result.Error(0)
100
-
iferr!=nil {
101
-
switchoutputFormat {
102
-
caseoutputFormatPlainText:
103
-
varout strings.Builder
104
-
out.WriteString("comparing the CRDs identified incompatible changes\n\n")
105
-
out.WriteString(err.Error())
106
-
log.Fatal(out.String())
107
-
caseoutputFormatJSON:
108
-
jsonOut, marshalError:=result.JSON()
109
-
ifmarshalError!=nil {
110
-
log.Fatalf("marshalling results to JSON: %v", marshalError)
111
-
}
112
-
fmt.Print(string(jsonOut))
113
-
os.Exit(1)
114
-
caseoutputFormatYAML:
115
-
yamlOut, marshalError:=result.YAML()
116
-
ifmarshalError!=nil {
117
-
log.Fatalf("marshalling results to YAML: %v", marshalError)
118
-
}
119
-
fmt.Print(string(yamlOut))
120
-
os.Exit(1)
121
-
}
78
+
fmt.Print(report)
79
+
ifresults.HasFailures() {
80
+
os.Exit(1)
122
81
}
123
82
},
124
83
}
125
84
126
85
rootCmd.AddCommand(NewVersionCommand())
127
86
rootCmd.PersistentFlags().StringVar(&configFile, "config", "", "the filepath to load the check configurations from")
128
-
rootCmd.PersistentFlags().StringVarP(&outputFormat, "output", "o", "plaintext", "the format the output should take when incompatibilities are identified. May be one of plaintext, json, yaml")
87
+
rootCmd.PersistentFlags().StringVarP(&outputFormat, "output", "o", "plaintext", "the format the output should take when incompatibilities are identified. May be one of plaintext, markdown, json, yaml")
0 commit comments