@@ -303,6 +303,27 @@ we will look into expanding its support of open API to v3, and investigate
303
303
whether it makes sense as a permanent solution to client-side validation that
304
304
will allow for deprecation of current client-side validation.
305
305
306
+ ##### Aligning json and yaml errors
307
+
308
+ A few discrepancies between sigs.k8s.io/yaml and sigs.k8s.io/json make detecting
309
+ and reporting strict errors inconsistent and should be addressed at some point.
310
+
311
+ 1 . sigs.k8s.io/yaml does not currently have a strict unmarshaling mechanism to
312
+ distinguish between strict and non-strict errors while sigs.k8s.io/json does.
313
+ This results in having to perform unmarshaling twice for yaml data in some
314
+ cases.
315
+ See [ this
316
+ discussion] ( https://github.com/kubernetes/kubernetes/pull/105916#discussion_r748530682 ) from the the alpha PR and the follow-up [ tracking
317
+ issue] ( https://github.com/kubernetes-sigs/yaml/issues/70 ) .
318
+
319
+ 2 . kyaml and kjson currently report strict decoding errors in different formats.
320
+ For example a duplicate field error appears from kyaml as `line 26: key
321
+ "imagePullPolicy" already set in map`, while kjson reports the error as
322
+ ` duplicate field "spec.template.spec.containers[0].imagePullPolicy" ` . For
323
+ consistencies sake, these two libraries should eventually report the same
324
+ errors in the same format.
325
+
326
+
306
327
<!--
307
328
What are the caveats to the proposal?
308
329
What are some important details that didn't come across above?
@@ -588,8 +609,6 @@ Below are some examples to consider, in addition to the aforementioned [maturity
588
609
- [ ] endpoints handler unit testing of field validation
589
610
- [ ] customresource handler unit testing of field validation
590
611
- [ ] field validation integration tests check for exact match of strict errors
591
- - [ ] [ make
592
- use] ( https://github.com/kubernetes/kubernetes/pull/105916#discussion_r746125180 ) of the decoded object rather than decoding multiple times
593
612
- [ ]
594
613
[ decide] ( https://github.com/kubernetes/kubernetes/pull/105916#discussion_r750769609 ) whether a fieldValidation=Strict fatal error should return before
595
614
an error from the apply operation.
0 commit comments