Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workaround for null values in the tag list #2544

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Aug 28, 2024

Motivated by containers/skopeo#2409 .

Untested so far.

@mtrmac
Copy link
Collaborator Author

mtrmac commented Aug 29, 2024

The fix was confirmed at containers/skopeo#2409 (comment) , ready for review.

@mtrmac mtrmac marked this pull request as ready for review August 29, 2024 19:22
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
// 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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to show which tag was it? Might help with some debugging efforts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Albeit, not sure if at all possible to do so.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

@kwilczynski
Copy link
Member

/approve
/lgtm

@mtrmac mtrmac merged commit b0abf43 into containers:main Sep 3, 2024
10 checks passed
@mtrmac mtrmac deleted the nexus-workaround branch September 3, 2024 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants