Workaround for int-or-string format issues #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kubernetes happily expects integers to be passed to fields of type
string, if they have the format int-or-string. This means the schema is
valid (because the rules around format are hazy) but actually validating
a document against a schema will fail - correctly in my view.
The proper fix for this likely involves some discussions with api
machinery and even some spec wrangling. In the meantime I'm going to
work around it here.
This first pass is pretty blunt. It has the potential to pass some
invalid documents with a warning. With a more specific jsonpath query,
and some parsing based on the Field() it's probably possible to make
this more accurate.