Skip to content

Explicitly set provider runtime#406

Open
stmcginnis wants to merge 1 commit into
kubernetes-sigs:mainfrom
stmcginnis:setruntime
Open

Explicitly set provider runtime#406
stmcginnis wants to merge 1 commit into
kubernetes-sigs:mainfrom
stmcginnis:setruntime

Conversation

@stmcginnis
Copy link
Copy Markdown
Contributor

Improves logic around which runtime to use, making sure to always account for KIND_EXPERIMENTAL_PROVIDER environment variable setting.

Related to: #404

Improves logic around which runtime to use, making sure to always
account for KIND_EXPERIMENTAL_PROVIDER environment variable setting.

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 4, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stmcginnis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@k8s-ci-robot k8s-ci-robot requested a review from aojea May 4, 2026 19:26
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 4, 2026
@aojea
Copy link
Copy Markdown
Contributor

aojea commented May 4, 2026

@avosepp are you able to check this patch to confirm it fixes the problem?

@avosepp
Copy link
Copy Markdown

avosepp commented May 4, 2026

log.txt

I compiled this with make build and ran it with sudo ./cloud-provider-kind --enable-lb-port-mapping and got this output. It seems like it is throwing a new error, but it did correctly attempt to use podman.

I'm not sure if this is a related to the way I'm running the app or not. But maybe these errors will help you.

@stmcginnis
Copy link
Copy Markdown
Contributor Author

Thanks - that error is something unrelated to proper runtime detection, so it looks like this does do what it's intended to do.

@stmcginnis
Copy link
Copy Markdown
Contributor Author

Guessing the error is maybe an environment issue? Have you seen this before @aojea?

"Failed to watch" err="failed to list *v1.ReferenceGrant: the server could not find the requested resource (get referencegrants.gateway.networking.k8s.io)" logger="UnhandledError" reflector="pkg/mod/k8s.io/client-go@v0.36.0/tools/cache/reflector.go:343" type="*v1.ReferenceGrant"

Well past the provider selection though, so this is definitely something unrelated.

@avosepp
Copy link
Copy Markdown

avosepp commented May 4, 2026

Wait! I'm sorry. I forgot I had Docker uninstalled. When reinstalling it I got the Docker ps error again. My brain jumped to testing the built binary and forgot to adjust my system.

Ignore this. I uninstalled docker, then ran with sudo and the ENV flag in the same line. And it did correctly recognize it need to run with podman. Then I had the same errors in the log.txt I posted above.

So it looks like yes. This fix works. Quite possibly the errors thrown in the log I uploaded above are just due to the way I built or ran the software when I self-compiled it.

@aojea
Copy link
Copy Markdown
Contributor

aojea commented May 18, 2026

@stmcginnis I think that right now we can remove init() entirely.
Then we move the autodetection logic from init() into an explicit helper, e.g. container.DetectRuntime()
and in cmd/app.go, do:

  1. if KIND_EXPERIMENTAL_PROVIDER is set, use it
  2. else p := container.DetectRuntime()
  3. build the kind provider option from p
  4. call container.SetRuntime(p)

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants