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

Clean up some warnings #2010

Merged
merged 4 commits into from
Jul 10, 2024
Merged

Clean up some warnings #2010

merged 4 commits into from
Jul 10, 2024

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Jul 10, 2024

from what golangci-lint and gopls check show. This is not comprehensive, primarily to minimize distractions when working on pkg/chunked.

Cc: @giuseppe primarily for a review of the context.Context removals.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Jul 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, mtrmac

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

mtrmac added 4 commits July 10, 2024 23:54
"default case should be first or last in switch statement (ST1015)"

Only moves unchanged code, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Conceptually, these read from the network and _should_ be interruptible.
But we could, at best, interrupt the wait on the channels returned by
GetBlobAt; we would then still get a ReadCloser where we can call
Read() but not concurrently notice a cancellation.

The cancellation needs to happen at the HTTP client side, i.e. inside
the c/image private.ImageSourceInternalOnly.GetBlobAt call (not ImageSourceSeekable),
and, although it seems not to be quite documented, the http stack's http.NewRequestWithContext
does cause the HTTP body transport to be terminated on a context cancellation.

I.e. it is out of control of this codebase anyway; so don't pretend to handle it.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@cgwalters
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jul 10, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 573c558 into containers:main Jul 10, 2024
18 checks passed
@mtrmac mtrmac deleted the warnings branch July 11, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants