Skip to content

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Oct 6, 2025

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 6, 2025
@Honny1 Honny1 marked this pull request as ready for review October 6, 2025 11:28
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 6, 2025
@Honny1 Honny1 added the No New Tests Allow PR to proceed without adding regression tests label Oct 6, 2025
@Honny1
Copy link
Member Author

Honny1 commented Oct 6, 2025

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Thanks, if we are in a rush to unblock things I am fine with this version although I think we should remove the arg altogether.

// Also returns the canonical network name, either auto-generated or user-defined via the
// NetworkName key-value.
func ConvertNetwork(network *parser.UnitFile, name string, unitsInfoMap map[string]*UnitInfo, isUser bool) (*parser.UnitFile, error, error) {
func ConvertNetwork(network *parser.UnitFile, _ string, unitsInfoMap map[string]*UnitInfo, isUser bool) (*parser.UnitFile, error, error) {
Copy link
Member

Choose a reason for hiding this comment

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

If we don't need that arg let's just remove it and simplify the callers. We only need to use _ if we need the arg to satisfy an interface or some other function signature or need to keep API compatibility which should not be the case here.

// Also returns the canonical volume name, either auto-generated or user-defined via the VolumeName
// key-value.
func ConvertVolume(volume *parser.UnitFile, name string, unitsInfoMap map[string]*UnitInfo, isUser bool) (*parser.UnitFile, error, error) {
func ConvertVolume(volume *parser.UnitFile, _ string, unitsInfoMap map[string]*UnitInfo, isUser bool) (*parser.UnitFile, error, error) {
Copy link
Member

Choose a reason for hiding this comment

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

same here

…rtVolume

The 'name' parameter was unused in both ConvertNetwork and ConvertVolume functions.
Remove the parameter entirely and update all function calls accordingly.

This fixes revive linter warnings:
- pkg/systemd/quadlet/quadlet.go:961:47: unused-parameter: parameter 'name' seems to be unused
- pkg/systemd/quadlet/quadlet.go:1050:45: unused-parameter: parameter 'name' seems to be unused

Signed-off-by: Jan Rodák <[email protected]>
@Honny1 Honny1 changed the title Fix linter: rename unused 'name' parameters to '_' quadlet: remove unused 'name' parameter from ConvertNetwork and ConvertVolume Oct 6, 2025
@Honny1
Copy link
Member Author

Honny1 commented Oct 6, 2025

Thanks, if we are in a rush to unblock things I am fine with this version although I think we should remove the arg altogether.

I removed the name parameter. It was simple. Let's wait for CI to finish to see if I broke something.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

cc @ygalblum

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2025
@ygalblum
Copy link
Contributor

ygalblum commented Oct 6, 2025

Thanks for the change. While you're at it, I can see that ConvertPod does not need it either. Then, once you remove it there as well, if you can please change the parameter order of ConvertContainer to align all calls (it's the only one that has isUserFlag before unitsInfoMap)

@Luap99
Copy link
Member

Luap99 commented Oct 6, 2025

Thanks for the change. While you're at it, I can see that ConvertPod does not need it either. Then, once you remove it there as well, if you can please change the parameter order of ConvertContainer to align all calls (it's the only one that has isUserFlag before unitsInfoMap)

Considering this is blocking main and other PRs currently I don't think we should make @Honny1 do additional cleanup work beyond what the linter issue is about.

This can always be fixed later if you want to change this.

@containers/podman-maintainers PTAL this is needed to unblock CI

@Honny1
Copy link
Member Author

Honny1 commented Oct 6, 2025

@ygalblum I've added cleanup to my to-do list and will handle it in a separate PR.

@ygalblum
Copy link
Contributor

ygalblum commented Oct 6, 2025

@Luap99 sure, didn't know it was blocking. But, how is ConvertVolume and ConvertNetwork different from ConvertPod that the formers are failing the linter and the latter isn't

@Luap99
Copy link
Member

Luap99 commented Oct 6, 2025

ConvertPod has the arg defined as _ string which the unused linter then ignores, i.e. that is useful if you have to implement interfaces where you don't need the arg.

090304a was using auto fixes and was quite large already so changing things manually to actually remove the args in cases where possible would have made the PR hard to review.
If we clean things up manually we should go over this and see where we can properly remove the args.

@ygalblum
Copy link
Contributor

ygalblum commented Oct 6, 2025

@Luap99 Thanks. I can now see that I was looking at a branch that did not include that commit

Copy link
Contributor

@ygalblum ygalblum 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 Oct 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Honny1, Luap99, ygalblum

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

@Luap99
Copy link
Member

Luap99 commented Oct 6, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 80b20c7 into containers:main Oct 6, 2025
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. No New Tests Allow PR to proceed without adding regression tests release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants