Skip to content

remove deadcode #26461

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

remove deadcode #26461

wants to merge 20 commits into from

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jun 18, 2025

see each commit, mostly straight forward removals however "podman images --sort autocomplete options", "remove unused ShouldRestart() code" and "podman images --sort use ChoiceValue flag" contain some small changes that I noticed during the removals.

Does this PR introduce a user-facing change?

None

Luap99 added 3 commits June 18, 2025 14:52
The functionwas added but never wired into the cli option so there never
where shell completions for this.

Signed-off-by: Paul Holzinger <[email protected]>
These functions are not used.

Signed-off-by: Paul Holzinger <[email protected]>
Deadcode should that the ShouldRestart() API endpoint was never wired
into the router so the endpoint did not existed and the bindings called
a non existing endpoint which returnd 404 which the binding code
assumed means no restart.

As such remove all this code as it didn't do anything useful. And IMO
exposing a shouldrestart API always feeled wrong to me. The client
should not have to deal with this.

This commit does not change the behavior but it also does not make an
attempt to fix the broken restart handling with the rmeote client. Given
we do not seem to have any user reports about this it seems it is not
used.

Signed-off-by: Paul Holzinger <[email protected]>
Copy link
Contributor

openshift-ci bot commented Jun 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2025
@Luap99 Luap99 added the No New Tests Allow PR to proceed without adding regression tests label Jun 18, 2025
@github-actions github-actions bot added machine kind/api-change Change to remote API; merits scrutiny labels Jun 18, 2025
Luap99 added 17 commits June 18, 2025 15:46
One might think Close() should be called but we are already using
Shutdown() which is the graceful way to stop the server so we don't
actually need Close().

Signed-off-by: Paul Holzinger <[email protected]>
Only one function, there are more public bindings that call a legit
server endpoint but are unused by podman-remote. As external users might
need/want them they should stay.

Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
Make use of our custom ChoiceValue flag type instead of using yet
another type. With that we can remove the StringSet type.

Signed-off-by: Paul Holzinger <[email protected]>
Note sure what these are supposed to be used for but they are unused.

Signed-off-by: Paul Holzinger <[email protected]>
We don't need a stub implementation as this code should never end up
being imported on non windows platforms.

Signed-off-by: Paul Holzinger <[email protected]>
Can always added back if it is really needed at some point.

Signed-off-by: Paul Holzinger <[email protected]>
Yes this is a lot.

Signed-off-by: Paul Holzinger <[email protected]>
These types are not used.

Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
It is not used here.

Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: Paul Holzinger <[email protected]>
All callers ignore the error anyways so no reason to return it as the
function itself already logs it.

Signed-off-by: Paul Holzinger <[email protected]>
@@ -382,20 +352,6 @@ func WithTmpDir(dir string) RuntimeOption {
}
}

// WithNoPivotRoot sets the runtime to use MS_MOVE instead of PIVOT_ROOT when
// starting containers.
func WithNoPivotRoot() RuntimeOption {
Copy link
Member

Choose a reason for hiding this comment

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

Wait what? This is kind of important. How is it not wired in?

Copy link
Member Author

Choose a reason for hiding this comment

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

there is no cli option for this is there? The code reads config.Engine.NoPivotRoot directly from containers.conf so this is not adding anything AFAICT

@mheon
Copy link
Member

mheon commented Jun 18, 2025

While I love the diffstat, I'm a bit concerned that some of these things aren't wired in...

@Luap99
Copy link
Member Author

Luap99 commented Jun 18, 2025

Speaks to our code quality/review process I guess...

I am fine dropping individual changes here if you want to keep something. And frankly I haven't even dropped everything, I completely ignored pkg/k8s.io for example. Mostly removed stuff I don't see any use for.

Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@baude
Copy link
Member

baude commented Jun 18, 2025

lgtm

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. kind/api-change Change to remote API; merits scrutiny machine 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