Add a workaround for null values in the tag list#2544
Conversation
1db7248 to
d78c244
Compare
|
The fix was confirmed at containers/skopeo#2409 (comment) , ready for review. |
d78c244 to
c7f2a04
Compare
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
c7f2a04 to
7d3dfc6
Compare
| // Per https://github.com/containers/skopeo/issues/2409 , Sonatype Nexus 3.58, contrary | ||
| // to the spec, may include JSON null values in the list; and Go silently parses them as "". | ||
| if tag == "" { | ||
| logrus.Debugf("Ignoring invalid empty tag") |
There was a problem hiding this comment.
Would it make sense to show which tag was it? Might help with some debugging efforts.
There was a problem hiding this comment.
Albeit, not sure if at all possible to do so.
There was a problem hiding this comment.
We just get a null in an array; the server does not tell us why it included a null.
(We could, with some extra effort, get the raw null value instead of "", and be able to report whether we got one or the other, but I don’t think that is all that much more helpful. If we did want to include more details, I’d be tempted to just dump an escaped version of the response body as is, instead of trying to parse it.
Ultimately, this is all a debug-level log that users are not expected to see unless they are specially looking for it.)
|
/approve |
Motivated by containers/skopeo#2409 .
Untested so far.