Skip to content

pkg/machine: remove unused InstalledProviders function - #29336

Open
Aryanbhargava18 wants to merge 1 commit into
podman-container-tools:mainfrom
Aryanbhargava18:fix/mac-provider-test-flake
Open

pkg/machine: remove unused InstalledProviders function#29336
Aryanbhargava18 wants to merge 1 commit into
podman-container-tools:mainfrom
Aryanbhargava18:fix/mac-provider-test-flake

Conversation

@Aryanbhargava18

@Aryanbhargava18 Aryanbhargava18 commented Jul 29, 2026

Copy link
Copy Markdown

Checklist

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all commits.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below
  • PR description, commit message, and GitHub comments are human-written, per LLM Policy

What this PR does / why we need it:

The InstalledProviders function in pkg/machine/provider/platform.go is unused everywhere in the codebase except within its own test cases. This PR removes the dead code entirely to clean up the API surface.

Does this PR introduce a user-facing change?

None

@Aryanbhargava18 Aryanbhargava18 changed the title test: do not hardcode installed providers on darwin pkg/machine: do not hardcode installed providers on darwin Jul 29, 2026
@Aryanbhargava18 Aryanbhargava18 changed the title pkg/machine: do not hardcode installed providers on darwin pkg/machine: fix test failures on macOS environments without libkrun Jul 29, 2026

@danishprakash danishprakash left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we even need InstalledProviders, doesn't seem to be used afaict. cc/ @ashley-cui

@Aryanbhargava18

Copy link
Copy Markdown
Author

Good catch @danishprakash. I audited the tree and InstalledProviders() isn't consumed anywhere outside of platform_test.go. I originally just patched the test to resolve the immediate CI flake on developer environments, but if it's dead code, deleting it entirely is definitely the cleaner fix.

I'm happy to push a commit to this PR dropping the function and its tests entirely if you and @ashley-cui agree.

@ashley-cui

Copy link
Copy Markdown
Contributor

Looks like dead code to me, I'd be okay with removing it.

@Aryanbhargava18
Aryanbhargava18 force-pushed the fix/mac-provider-test-flake branch from 8b5ad71 to 6c11745 Compare July 29, 2026 15:58
@Aryanbhargava18 Aryanbhargava18 changed the title pkg/machine: fix test failures on macOS environments without libkrun pkg/machine: remove unused InstalledProviders function Jul 29, 2026
@packit-as-a-service

Copy link
Copy Markdown

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

@Aryanbhargava18

Copy link
Copy Markdown
Author

I've dropped InstalledProviders() and its associated tests entirely in the latest commit as discussed. Ready for another look whenever you have time @danishprakash @ashley-cui.

@danishprakash danishprakash left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There seems to be some issues, can you please run make validatepr and fix them?

@Aryanbhargava18
Aryanbhargava18 force-pushed the fix/mac-provider-test-flake branch from 6c11745 to 4213bfe Compare July 29, 2026 16:48
@Aryanbhargava18

Copy link
Copy Markdown
Author

There seems to be some issues, can you please run make validatepr and fix them?

Deleting the function left behind an unused import (define) in platform.go. I've dropped the unused import and ran gofmt in the latest push. It should be fine now.

"go.podman.io/podman/v6/pkg/machine/vmconfigs"
)

func InstalledProviders() ([]define.VMType, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do you mind also cleaning up SupportedProviders and associated tests? that's also dead

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

do you mind also cleaning up SupportedProviders and associated tests? that's also dead

Done. I went ahead and purged SupportedProviders and its associated tests across all architectures since they were dead code as well.

The InstalledProviders function was only used in its own tests and is otherwise dead code. Removing it entirely cleans up the API surface.

Signed-off-by: Aryanbhargava18 <aryanbhargava644@gmail.com>
@Aryanbhargava18
Aryanbhargava18 force-pushed the fix/mac-provider-test-flake branch from 4213bfe to f3d79ba Compare July 30, 2026 08:31
@danishprakash danishprakash added the kind/cleanup Categorizes issue or PR as related to cleanup. label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleanup. machine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants