Skip to content

CI: Lint on more os/arch variants - #23761

Open
mk24x7 wants to merge 2 commits into
kubernetes:masterfrom
mk24x7:ci/23746_lint-all-os-arch
Open

mk24x7 wants to merge 2 commits into
kubernetes:masterfrom
mk24x7:ci/23746_lint-all-os-arch

Conversation

@mk24x7

@mk24x7 mk24x7 commented Sep 19, 2026

Copy link
Copy Markdown

Run the Lint job on more os/arch variants, so lint issues in code behind build tags are caught in CI.

The Lint job ran only on ubuntu-latest, so issues in code guarded by //go:build darwin were never linted. The job now runs on ubuntu-24.04, macos-26 and macos-26-intel, with fail-fast disabled so one variant does not mask the others.

The macOS commit fixes what this revealed:

  • pkg/drivers/vfkit/vfkit.go: fmt.Fprintf with no format arguments
  • pkg/minikube/registry/drvs/krunkit/krunkit.go: unchecked type assertion that could panic
  • pkg/minikube/registry/drvs/parallels/parallels.go: unchecked type assertion that could panic, using the same pattern as the vmware driver

Not included, per review:

  • windows-2025, and the windows lint fixes, removed from this PR
  • ubuntu-24.04-arm, since the kvm driver is not built on arm64 and lint reports unused code there that is used on amd64

Fixes #23746

@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 19, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 19, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @mk24x7!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 19, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @mk24x7. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@minikube-bot

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@mk24x7
mk24x7 force-pushed the ci/23746_lint-all-os-arch branch from edba5bb to e5f3105 Compare September 19, 2026 20:58
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 19, 2026
@mk24x7 mk24x7 changed the title Ci/23746 lint all os arch ci: run make lint on all os/arch variants Sep 19, 2026
@nirs nirs self-assigned this Sep 21, 2026

@nirs nirs 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.

I will help if you post first the workflows changes so I can see the linter errors. Or share the errors from CI in a comment.

Comment thread .github/workflows/lint.yml Outdated
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mk24x7
Once this PR has been reviewed and has the lgtm label, please ask for approval from nirs. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@nirs nirs changed the title ci: run make lint on all os/arch variants ci: Lint on all os/arch variants Sep 21, 2026
@nirs nirs changed the title ci: Lint on all os/arch variants CI: Lint on all os/arch variants Sep 21, 2026
@nirs

nirs commented Sep 21, 2026

Copy link
Copy Markdown
Member

@mk24x7 The windows lint does not work. You can test locally or in your fork.

= make lint =============================================================
out/linters/golangci-lint-2.12.2-windows-amd64.tar.gz: No such file or directory
B0050000:error:80000002:system library:file_ctrl:No such file or directory:../openssl-3.5.7/crypto/bio/bss_file.c:299:calling fopen(out/linters/golangci-lint-2.12.2-windows-amd64.tar.gz, rb)
B0050000:error:10080002:BIO routines:file_ctrl:system lib:../openssl-3.5.7/crypto/bio/bss_file.c:302:
tar (child): out/linters/golangci-lint-2.12.2-windows-amd64.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
mv: cannot stat '/tmp/tmp.hDtBTgou6F/golangci-lint-2.12.2-windows-amd64/golangci-lint': No such file or directory
chmod: cannot access 'out/linters/golangci-lint-v2.12.2': No such file or directory
/usr/bin/sh: line 1: ./out/linters/golangci-lint-v2.12.2: No such file or directory
make[1]: *** [Makefile:532: lint-ci] Error 127

It will be good enough to remove the windows lint from this PR since it requires additional work. We can open a new issue to make make lint compatible with windows.

Another solution is to use the golangci-lint action intead of running it manually. I'm not sure make is the right solution for windows.

@bobsira can you help with this? What it the best way to handle this on Windows?

@nirs

nirs commented Sep 21, 2026

Copy link
Copy Markdown
Member

linux/arm64 is not included, and needs your call

GOOS=linux GOARCH=arm64 reports 12 issues, all in pkg/drivers/kvm, and they are structural rather than defects:

kvm_stub.go:33:5: ST1012: error var notSupported should have name of the form errFoo (staticcheck)

This seems like an easy fix, use the standard name pattern?

disks.go:28:7: const extraDisksTmpl is unused (unused)
disks.go:44:6: func getExtraDiskXML is unused (unused)
domain_definition_arm64.go:21:7: const domainTmpl is unused (unused)
gpu.go: 7 more unused (sysFsPCIDevicesPath, sysKernelIOMMUGroupsPath, nvidiaVendorID, devicesTmpl, getDevicesXML, getPassthroughableNVIDIADevices, isIsolated, isUnbound)


The cause is that `kvm.go` and `domain.go` are tagged `linux && amd64`, while `gpu.go` and `disks.go` are tagged plain `linux`. On arm64 the callers disappear but the helpers still compile, so `unused` fires on code that is correct and needed on amd64. I confirmed every real caller is inside the amd64-only set.

The fix is arguably to tag `gpu.go` and `disks.go` as `linux && amd64` too, but that changes how the driver files are organised, so I did not want to decide it here. How would you like it handled? I am happy to add it to this PR or send a follow-up.

Yes, the kvm driver is not compiled on arm for years. We need to use a special cross compiler configuration to make it work and we did not have time to work on it yet.

For now, we can fix the tags to match the build and avoid lint errors.

ubuntu-24.04-arm is in the matrix, so that job will fail until this is resolved.

You can start by removing it from the matrix so we can merge the easy fixes now and open an issue for fixing kvm lint issues.

@nirs nirs 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.

@mk24x7 Please squash the last commit info the first, adding the reason we skip windows and linux-arm for now.

@nirs

nirs commented Sep 21, 2026

Copy link
Copy Markdown
Member

@mk24x7 The current change is good, revealing lint issues on macOS, but it does unneeded work since the Lint job is using the wrong target.

Before we run the Lint job on multiple os/arch, we need to fix it to actually run make lint: #23776

@nirs nirs changed the title CI: Lint on all os/arch variants CI: Lint on more os/arch variants Sep 21, 2026
@nirs

nirs commented Sep 21, 2026

Copy link
Copy Markdown
Member

@mk24x7 Also update the PR description to describe the current change.

@nirs

nirs commented Sep 21, 2026

Copy link
Copy Markdown
Member

@mk24x7 The windows unit tests fail - maybe windows lint issue are wrong? Please remove them from this PR since we don't have a lint job to verify them yet.

@mk24x7
mk24x7 force-pushed the ci/23746_lint-all-os-arch branch 2 times, most recently from fd04696 to 8418f99 Compare September 21, 2026 14:23
The Lint job ran only on ubuntu-latest, so build tags hid lint issues in
code guarded by //go:build darwin or windows. Those issues surfaced only
on developer machines.

Run the job on a matrix of os/arch variants instead: ubuntu-24.04,
macos-26 and macos-26-intel.

fail-fast is disabled so one failing variant does not mask the others,
and the lint step runs under bash so the same command works everywhere.

windows-2025 and ubuntu-24.04-arm are skipped for now. The kvm driver is
not built on arm64, so linting it there reports unused code that is used
on amd64. make lint does not work on Windows yet, because the
golangci-lint download assumes a tar.gz archive while the release
publishes a zip for Windows. Both will be handled in follow up issues.

Adding the jobs first surfaces the issues that need fixing. Fixes for
those follow in later commits.
These are in code guarded by darwin build tags, so the linux-only lint
job never saw them.

vfkit: the first two writes have no formatting arguments, so use
fmt.Fprint instead of fmt.Fprintf.

krunkit: the unchecked type assertion on the error returned by
vmnet.ValidateHelper panics if the error is not a *vmnet.Error. Use
errors.As and fall back to the original error when it does not match.

parallels: the unchecked type assertion on the driver panics if the
type ever changes. Check it and return an error instead, matching the
existing pattern in the vmware driver.
@mk24x7
mk24x7 force-pushed the ci/23746_lint-all-os-arch branch from 8418f99 to 8f2ed8b Compare September 21, 2026 14:24
@mk24x7
mk24x7 force-pushed the ci/23746_lint-all-os-arch branch from 8f2ed8b to 6064556 Compare September 21, 2026 14:34
@mk24x7

mk24x7 commented Sep 21, 2026

Copy link
Copy Markdown
Author

Removed the windows lint fixes and windows-2025 from this PR, and updated the description. It is now the matrix on ubuntu and macos, plus the three macos fixes.

How would you like to sequence this with #23776? Happy to hold this until that is fixed, or to drop the workflow change here and leave just the macos fixes, whichever works better for you.

@nirs

nirs commented Sep 21, 2026

Copy link
Copy Markdown
Member

Removed the windows lint fixes and windows-2025 from this PR, and updated the description. It is now the matrix on ubuntu and macos, plus the three macos fixes.

How would you like to sequence this with #23776? Happy to hold this until that is fixed, or to drop the workflow change here and leave just the macos fixes, whichever works better for you.

@mk24x7 We can hold this change until #23776 is fixed.

@nirs

nirs commented Sep 22, 2026

Copy link
Copy Markdown
Member

@mk24x7 Note the failure on macos-26-intel:
https://github.com/kubernetes/minikube/actions/runs/35613074917/job/106953844142

The inel runners are much slower so we need bigger timeouts. This failure may not be relevant after #23782.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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.

Run make lint on all os/arch variants

3 participants