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

Fix the surrounding loop is unconditionally terminated (SA4004) #1986

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Jun 24, 2024

This PR fixes the surrounding loop is unconditionally terminated warning (SA4004) found by golangci when the staticcheck linter is enabled.

Partially fixes:

@rhatdan
Copy link
Member

rhatdan commented Jun 24, 2024

LGTM

}
return target, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

@giuseppe @ktock “Additional layer stores” support multiple stores, but apparently the code was only able to work with the first one, since the very start of the feature ( 64f0181 ).

What do you think about simplifying to only support one store? Admittedly that would not help simplify the codebase all that much, ALS is AFAICS only a feature within this driver and ~this one loop — and instead, we would need to add even more code to reject multiple stores when parsing options.

Either way, we seem not to have tests sufficiently covering the feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about simplifying to only support one store?

SGTM

drivers/overlay/overlay.go Outdated Show resolved Hide resolved
drivers/overlay/overlay.go Outdated Show resolved Hide resolved
drivers/overlay/overlay.go Outdated Show resolved Hide resolved
@Honny1 Honny1 force-pushed the fix-loop-unconditionally-terminated branch from 7afa207 to 72f7e88 Compare June 24, 2024 15:34
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

LGTM, just a non-blocking stylistic nit.

Please squash follow-on fixes instead of leaving the original versions of commits in the PR in the history.

drivers/overlay/overlay.go Outdated Show resolved Hide resolved
@Honny1 Honny1 force-pushed the fix-loop-unconditionally-terminated branch from 72f7e88 to 34832d4 Compare June 24, 2024 16:02
@Honny1 Honny1 force-pushed the fix-loop-unconditionally-terminated branch from 34832d4 to 599c5d0 Compare June 24, 2024 16:03
@rhatdan
Copy link
Member

rhatdan commented Jun 24, 2024

/approve
/lgtm
Thanks @Honny1

Copy link
Contributor

openshift-ci bot commented Jun 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Honny1, rhatdan

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
Copy link
Collaborator

mtrmac commented Jun 24, 2024

/lgtm

@openshift-merge-bot openshift-merge-bot bot merged commit b82b284 into containers:main Jun 24, 2024
18 checks passed
@Honny1 Honny1 deleted the fix-loop-unconditionally-terminated branch July 1, 2024 15:53
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.

4 participants