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

Solve errcheck warnings (part 5) #2006

Merged
merged 7 commits into from
Jul 9, 2024

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Jul 8, 2024

This PR is one of several fixes of warnings found by golangci when the errcheck linter is enabled.

Partially fixes:

@Honny1 Honny1 force-pushed the fix-errcheck-5 branch 2 times, most recently from 8bd9c5f to ab00b68 Compare July 8, 2024 14:23
@Honny1 Honny1 marked this pull request as ready for review July 8, 2024 15:11
cmd/containers-storage/diff.go Outdated Show resolved Hide resolved
drivers/overlay/overlay.go Outdated Show resolved Hide resolved
@@ -193,7 +193,9 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts, ro bool
}
labelOpts := []string{"level:s0"}
if _, mountLabel, err := label.InitLabels(labelOpts); err == nil {
label.SetFileLabel(dir, mountLabel)
if err := label.SetFileLabel(dir, mountLabel); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we fail the entire operation if this fails? Wouldn’t it break on non-SELinux systems? Maybe a debug log is the best we can do here.

Cc: @rhatdan , history is 73617e5 .

Copy link
Member

Choose a reason for hiding this comment

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

mountlabel should be "" on a non SELinux system.

SetFileLabel becomes a no-op.

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 I think, I’ll give this a few days to allow others review the SetFileLabel part at least.

@rhatdan
Copy link
Member

rhatdan commented Jul 9, 2024

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Jul 9, 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

@openshift-ci openshift-ci bot added the approved label Jul 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 876118a into containers:main Jul 9, 2024
18 checks passed
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.

3 participants