Repository navigation
🐛 Fix signalProcess redeclaration on Windows - #3586
kubernetes-prow[bot] merged 2 commits into
Conversation
signal_windows.go declares signalProcess as a function, while process.go declares it as a var holding signalProcessImpl. On Windows the two collide and signalProcessImpl is undefined, so anything importing pkg/envtest fails to compile. v0.24.1 still cross-builds for Windows, so this is new in v0.25.0. kubernetes-sigs#3519 added signal_windows.go. kubernetes-sigs#3523 then added the signalProcessImpl indirection so tests can stub the call, and renamed the function in signal_unix.go and signal_other.go but not in the Windows file. CI builds on Linux only, so nothing caught it. Signed-off-by: Jan Dubois <[email protected]>
|
|
|
Welcome @jandubois! |
|
Hi @jandubois. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
| ) | ||
|
|
||
| func signalProcess(process *os.Process, _ syscall.Signal) error { | ||
| func signalProcessImpl(process *os.Process, _ syscall.Signal) error { |
There was a problem hiding this comment.
I don't think this is very useful unless we also enable testing that c-r builds on windows
There was a problem hiding this comment.
I totally agree that it would be great to run CI on Windows as well. But I don't understand why that would block fixing a regression.
#3519 split off signal_windows.go from signal_others.go.
#3523 changed the declaration for signalProcess in signal_unix.go and signal_others.go, but didn't know about signal_windows.go.
This happened because #3523 was created on May 21st while #3519 wasn't merged until June 13th. So signal_windows.go did not exist yet on main by the time the second PR was written.
It is the combination of these 2 PRs that is breaking compilation on Windows, and the fix is a trivial 1 line change that is identical to what #3523 did for signal_unix.go and signal_others.go.
So while this change currently won't be verified by CI because it doesn't run on Windows, I don't think restoring compatibility is useless. But a manual comparison with signal_unix.go and signal_others.go should show that this is the right change.
There was a problem hiding this comment.
@sbueringer Since you approved #3519, which created signal_windows.go, could you have a look, if you have the time?
There was a problem hiding this comment.
He is on pto. Fixing a regression without testing just means it's likely to break again.
There was a problem hiding this comment.
Is there a way we could enable some testing on Windows?
There was a problem hiding this comment.
I think we can just crossbuild or not?
There was a problem hiding this comment.
I hope so, @jandubois?
(I should have written "for Windows" not "on Windows")
There was a problem hiding this comment.
I think we can just crossbuild or not?
Yes, that is simple. I've pushed cda36d9 to the current PR to do that.
Is there a way we could enable some testing on Windows?
I thought that was what @alvaroaleman was asking for. This needs to run as GHA and cannot run on Prow. I started looking into this using AI, but it is unfinished because I had to work on something else:
That branch is green on Windows:
It is skipping some tests that are written in shell, and there may be some other missing functionality.
The branch is also missing a proper review by myself, writing commit messages etc.
Let me know if having a PR mostly written via AI is acceptable to the project, and I can finish it up as a separate PR.
Signed-off-by: Jan Dubois <[email protected]>
v0.25.1 fails to compile on Windows because signalProcess is redeclared. Retain the last working release until kubernetes-sigs/controller-runtime#3586 is shipped. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Dariusz Porowski <[email protected]>
v0.25.1 fails to compile on Windows because signalProcess is redeclared. Retain the last working release until kubernetes-sigs/controller-runtime#3586 is shipped. Signed-off-by: Dariusz Porowski <[email protected]>
v0.25.1 fails to compile on Windows because signalProcess is redeclared. Retain the last working release until kubernetes-sigs/controller-runtime#3586 is shipped. Signed-off-by: Dariusz Porowski <[email protected]>
|
/ok-to-test |
|
/lgtm /assign @alvaroaleman |
|
LGTM label has been added. DetailsGit tree hash: 0a1e0851590180ef0a92baa97b5f53198c12b496 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, jandubois The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thanks! Did you want me to turn jandubois#1 into a proper upstream PR, or is the cross-compile enough for you? |
Thanks, but I don't think we can use GHA for this because the k8s org has very little minutes and Prow has no windows workers, so there is likely no easy way to test on Windows. The building is probably good enough for now |
|
I don't think there is a limit for public repos when using the default runners, but it's fine; if you are happy, then I'm happy. 😄 |
…hips a fix controller-runtime v0.25.0 through v0.25.2 does not compile pkg/internal/testing/process for Windows (signalProcess is redeclared), so the Lint (windows-latest) typecheck fails on this envtest import. The fix, kubernetes-sigs/controller-runtime#3586, is only on main so far. This is the only envtest importer, and the Windows unit test job does not cover ./crd/..., so no coverage is lost. Co-authored-by: Copilot <[email protected]>
…test fix Every controller-runtime v0.25.x release fails to compile envtest for GOOS=windows, which breaks the vela CLI build there because vela def test uses it. Replace controller-runtime with the main-branch commit that fixes it (kubernetes-sigs/controller-runtime#3586). That commit is on k8s 0.37 and already has every fix in v0.25.2. Move to the v0.26.0 release once it is tagged (kubevela#7451). Signed-off-by: Ayush Kumar <[email protected]>
* chore: test PR Signed-off-by: anish bista <[email protected]> * chore: upgrade crossplane-runtime to v2.3.3 Move from github.com/crossplane/crossplane-runtime v1.16.0 to the v2 module (github.com/crossplane/crossplane-runtime/v2 v2.3.3) and update all import paths (pkg/event, pkg/fieldpath, pkg/meta, pkg/test) accordingly. Signed-off-by: anish bista <[email protected]> * chore: upgrade golangci-lint to v2.12.2 Migrate .golangci.yml to the v2 config schema and bump the pinned version in makefiles/dependency.mk and CI. golangci-lint-action is bumped v6 -> v9 since v6 only supports golangci-lint v1 binaries. v2 dropped the run --exclude-dirs/-e CLI flags, so the scaffold path exclusion and the SDK-validation lint invocation are moved to config-based exclusions instead. The version bump surfaces a large number of pre-existing findings (mostly staticcheck quickfix/deprecation checks, plus goconst, gosec, noctx and recvcheck which are new/stricter under v2). These are suppressed for now to keep CI green; fixing them is left to a follow-up cleanup PR. Signed-off-by: anish bista <[email protected]> * chore: align env-setup action default Go version to 1.25.12 The env-setup composite action still defaulted to Go 1.23.8 while Dockerfiles and other CI workflows had already moved to 1.25.12. Signed-off-by: anish bista <[email protected]> * chore: bump kind to v1.35.5 and rename e2e CI job to 1.35 Bump the setup-kind-cluster action's default node image and all workflow matrices from v1.31.9 to v1.35.5, and bump the kind CLI itself from v0.29.0 to v0.32.0 to support the newer node image (matching the combo already used in webhook-upgrade-validation.yml). e2e-test.yml's matrix value is renamed from v1.31 to v1.35, which also renames the corresponding CI check. Signed-off-by: anish bista <[email protected]> * Fix: e2e addon test fixture no longer exercises k8s version-mismatch path fluxcd-test-version v2.0.0 declared system.kubernetes: ">=1.32.0" so it would fail the system-requirements check against the old kind cluster (v1.31.9), exercising the "system requirements not met" interactive prompt/abort path in e2e/addon/addon_test.go. Now that kind is bumped to v1.35.5, that constraint is satisfied and the addon enables directly without prompting, breaking the two tests that expect the prompt. Bump the fixture's constraint to ">=1.36.0" so it again sits just above the cluster version, restoring the intended test behavior. Signed-off-by: anish bista <[email protected]> * Fix: unit tests broken by k8s.io/apimachinery + Go 1.25 omitzero change Two unrelated issues surfaced by the k8s dependency bump: 1. k8s.io/apimachinery's ObjectMeta.CreationTimestamp field tag gained omitzero (json:"creationTimestamp,omitempty,omitzero"), which Go 1.25's encoding/json now honors. Zero-value CreationTimestamp is no longer serialized as "creationTimestamp: null"/"creationTimestamp": null in YAML/JSON output. This is the correct, intended behavior of the new library + toolchain combination, not a regression - the affected test fixtures in references/cli/def_test.go, references/cli/revision_test.go and references/cli/utils_test.go are updated to match. 2. TestCreateOrUpdateObjects in references/appfile/run_test.go shared one package-level *corev1.ConfigMap across two subtests. The fake client's Create() (controller-runtime v0.23.3) now clears TypeMeta on the object passed to it, matching real client-go behavior. Since the "create object" subtest passed the shared object to Create(), it silently lost its Kind, which the following "update object" subtest then inherited via DeepCopy(), breaking CreateOrUpdateObjects's internal unstructured.Unstructured GVK lookup. Give each subtest its own object instead of sharing mutable state. Verified locally: references/cli, references/appfile and pkg/addon suites all pass (793 tests) against kind v1.35.0 envtest binaries. Signed-off-by: anish bista <[email protected]> * Fix: install golangci-lint via go install instead of curl script The upstream install.sh script has been hitting checksum verification failures in CI. Since golangci-lint v2's module path is versioned (github.com/golangci/golangci-lint/v2), `go install` works directly and avoids the shell script entirely. Signed-off-by: anish bista <[email protected]> * Fix: regenerate CRDs for controller-gen v0.20.0, bump clientgen.sh pin check-diff failed because the checked-in CRD manifests still carried the controller-gen.kubebuilder.io/version: v0.16.5 annotation from before the sigs.k8s.io/controller-tools bump to v0.20.0 in go.mod. Regenerated via `make manifests` (go generate uses controller-gen at the go.mod-pinned version), which only touched that annotation line across the 9 CRD files - no schema changes. Also bump hack/apis/clientgen.sh's EXPECTED_CONTROLLER_GEN_VERSION pin to v0.20.0 to match, so its standalone deepcopy-gen step stays consistent with the version used by `make manifests`. Signed-off-by: anish bista <[email protected]> * Fix: e2e plugin live-diff fixture for k8s.io/apimachinery omitzero change Same root cause as the earlier references/cli fixture fixes: with CreationTimestamp now tagged omitzero and Go 1.25's encoding/json honoring it, `vela live-diff` output no longer prints "creationTimestamp: null" for the zero-value field. Verified the rest of the fixture is byte-identical to the actual CI output. Signed-off-by: anish bista <[email protected]> * Fix: bump license-check Ruby from EOL 2.6 to 3.3 ruby/setup-ruby's bundler bootstrap for Ruby 2.6 was failing with "too many connection resets" against rubygems.org - a known symptom of EOL Ruby 2.6's bundled OpenSSL/TLS stack against rubygems.org's modern TLS requirements. Nothing in the repo pins Ruby 2.6 (no Gemfile; license_finder is installed directly via `gem install`), so there's no reason to stay on an unmaintained Ruby version here. Verified locally: license_finder 7.2.1 installs and runs cleanly against .license/dependency_decisions.yml on a modern Ruby, reporting "All dependencies are approved for use". Signed-off-by: anish bista <[email protected]> * chore: retrigger the CI Signed-off-by: anish bista <[email protected]> * Chore: bump Go to 1.27.1 and k8s deps to v0.37.1 - go 1.27.1 in go.mod, CI and Dockerfiles; k8s.io libraries v0.37.1, controller-runtime v0.25.2, controller-tools v0.22.0 - kubevela/pkg, kubevela/workflow, oam-dev/cluster-gateway, cluster-register, terraform-config-inspect, terraform-controller and stern pinned to their current main commits, all on k8s 0.37 - crossplane-runtime v1 dropped; remaining imports moved to /v2 - drop the apiserver-runtime fork replace, nothing imports it any more - replace distribution/v3, moby/sys/user, timestamp-authority/v2 and go-kit/kit with fixed releases (module graph only) - kind v0.33.0 with node v1.37.0, golangci-lint v2.14.0, controller-gen v0.22.0, envtest 1.37.0, CI kubectl v1.37.1 - regenerate CRDs with controller-gen v0.22.0 - bump the Go SDK scaffold go.mod to the same core-api, pkg, workflow and k8s versions and drop its old cue fork replace - fix vet and lint findings from the new toolchain: %q used with ints in an e2e test, an *int32 port printed with %d, reflect.Ptr and slice.ContainsString deprecations Signed-off-by: Ayush Kumar <[email protected]> * Chore: bump staticcheck and address review comments - staticcheck v0.8.1, the older one can't read go1.27 export data - raise the addon e2e fixture's system.kubernetes floor above the v1.37.0 kind node so the version-mismatch prompt is still tested - k3d-create now uses K3D_VERSION for the k3s image - docs: envtest 1.37.0, kind v0.33.0, konnectivity-client v0.0.36 in the Go SDK scaffold instructions Signed-off-by: Ayush Kumar <[email protected]> * Chore: pin controller-runtime to the main commit with the Windows envtest fix Every controller-runtime v0.25.x release fails to compile envtest for GOOS=windows, which breaks the vela CLI build there because vela def test uses it. Replace controller-runtime with the main-branch commit that fixes it (kubernetes-sigs/controller-runtime#3586). That commit is on k8s 0.37 and already has every fix in v0.25.2. Move to the v0.26.0 release once it is tagged (#7451). Signed-off-by: Ayush Kumar <[email protected]> * Chore: install the pinned staticcheck when an older one is on PATH staticchecktool used any staticcheck it found on PATH, so an older binary that cannot read go1.27 export data kept being used. Check the version like the golangci target does and install v0.8.1 otherwise. Signed-off-by: Ayush Kumar <[email protected]> * Chore: leave k3d-create as it was Revert the K3D_VERSION and --image change; the webhook debug target is unrelated to this bump. Signed-off-by: Ayush Kumar <[email protected]> * Fix: run Go SDK generation with Go 1.27.1 vela def gen-api tidies the generated SDK in a golang:1.23.8 container, which refuses the scaffold's go 1.27.1 directive. Use the golang 1.27.1-alpine image the Dockerfiles use, from one constant. Signed-off-by: Ayush Kumar <[email protected]> * Fix(chart): let a fresh install finish on Kubernetes 1.37 hubs Since Kubernetes 1.37 the aggregator verifies TLS with the APIService's caBundle for the availability check. The chart rendered the cluster-gateway APIService with the Cg== placeholder until the post-install patch Job wrote the real CA, so on a fresh install the APIService never became Available, vela-core never became ready, and helm install --wait timed out before the patch Job ran. Render insecureSkipTLSVerify: true and no caBundle until there is a CA. The patch Job already writes the CA and sets insecureSkipTLSVerify back to false. An existing valid caBundle is still kept on upgrade, and the cert-manager and secureTLS-off paths are unchanged. Signed-off-by: Ayush Kumar <[email protected]> * Fix(ci): give the SDK lint exclusions a linter golangci-lint v2.14 rejects an exclusion rule that only sets text. Signed-off-by: Ayush Kumar <[email protected]> * Docs(chart): the APIService TLS check changed in Kubernetes 1.36 Correct the version in the cluster-gateway APIService comment and link kubernetes/kubernetes#137157, which made the availability check use the APIService's caBundle. Signed-off-by: Ayush Kumar <[email protected]> * Fix(cuetest): match the Kubernetes 1.37 API server and Go 1.27 - add MutatingAdmissionPolicy, MutatingAdmissionPolicyBinding and DeviceTaintRule to the cluster-scoped kinds; the 1.37 API server serves them, so vela def test treated them as namespaced - Go 1.27's encoding/json names the pointer type (*cue.Value) in MarshalJSON errors; update the expected message Signed-off-by: Ayush Kumar <[email protected]> * Fix(ci): install the upgrade baseline without secure gateway TLS The upgrade checks first install the latest release, whose chart can't finish a fresh install on Kubernetes 1.36+ hubs with secure TLS for cluster-gateway (#7452). Install that baseline with multicluster.clusterGateway.secureTLS.enabled=false until a release with the chart fix is out. Signed-off-by: Ayush Kumar <[email protected]> * Style: apply make fmt with Go 1.27 goimports drops the empty import block controller-gen v0.22.0 writes in the deepcopy files, and Go 1.27 gofmt re-indents multi-value return literals in four workflow provider tests. Formatting only. Signed-off-by: Ayush Kumar <[email protected]> * Chore: retrigger CI Signed-off-by: Ayush Kumar <[email protected]> --------- Signed-off-by: anish bista <[email protected]> Signed-off-by: Ayush Kumar <[email protected]> Co-authored-by: anish bista <[email protected]>
|
/cherry-pick release-0.25 |
|
@troy0820: new pull request created: #3621 DetailsIn response to this:
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. |
signal_windows.godeclaressignalProcessas a function, whileprocess.godeclares it as a var holdingsignalProcessImpl. On Windows the two collide andsignalProcessImplis undefined, so anything importingpkg/envtestfails to compile. #3519 added the Windows file; #3523 then added the indirection and renamed the unix and other implementations but not this one.v0.24.1 cross-builds for Windows, so this is a regression in v0.25.0 and needs a cherry-pick to
release-0.25.Verified with
GOOS=windows go build ./..., plusgo test ./pkg/internal/testing/process/...on darwin.GOOS=windows go vet ./pkg/...still fails:process_test.gocallssyscall.Killandsyscall.Getpgid, so the package's tests do not build on Windows. That is separate from this compile break and I left it alone.