setup-envtest requires elevation on Windows ARM64; an asInvoker manifest fixes launch

Aperta
#3,656 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
build-system, cli

Direzione di ricerca

Start by locating how setup-envtest is built and how Windows resources are embedded, especially for source builds used by go tool and go install. Add the requested asInvoker execution-level manifest to those builds, then verify the executable launches on Windows ARM64 without elevation and that help works.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

On a Windows ARM64 machine, version v0.24.1 fails before executing any code, even when requesting help:

go tool setup-envtest --help
...setup-envtest.exe: The requested operation requires elevation.

Windows returns 740 (ERROR_ELEVATION_REQUIRED). The tool should not need administrator privileges to print help.

The suspected root cause is a bug in Windows on ARM64, rather than in setup-envtest itself. However, if we embed a manifest declaring that the tool does not require administrator privileges, that works around the issue and is idiomatic Windows executable configuration anyway, following Microsoft's Windows guidance.

Reproduction and findings

The standalone harness at https://github.com/brooke-hamilton/setup-envtest-windows-repro reproduces the failure without downloading Kubernetes binaries or running tests:

git clone https://github.com/brooke-hamilton/setup-envtest-windows-repro.git
Set-Location setup-envtest-windows-repro
$env:GOTOOLCHAIN = 'go1.27.4'
.\repro.ps1

Run from non-administrator PowerShell 7. Both machines used Go 1.27.4, setup-envtest v0.24.1, and native executables matching their architectures.

Launch comparison Windows ARM64 Windows AMD64
go tool setup-envtest --help Child launch fails: elevation required Help prints
Cached executable launched directly Error 740 Help prints
Unchanged setup-envtest.exe copy Error 740 Help prints
Identical copy renamed envtest-probe.exe, same directory Help prints Help prints
Setup-named copy with embedded asInvoker manifest, same path Help prints Help prints

All successful help launches exited with code 2. Within each run, the three original binaries had identical hashes and no embedded manifests.

The affected machine runs Windows 11 Enterprise 26H2, build 26300.9725; the AMD64 comparison runs 25H2, build 26200.9711.

Requested change

Embed an explicit Windows execution-level manifest:

<requestedExecutionLevel level="asInvoker" uiAccess="false" />

This declares that the tool runs with its caller's privileges, without requesting elevation. It follows Microsoft's recommendation to embed an explicit manifest and fixes the observed launch failure.

Please cover source builds used by go tool and go install, not only release binaries.

Lingua principale
Go
Stelle
3k
Fork
1.3k
Merge medio
1g 7h
PR unite (30g)
48

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kubernetes-sigs/controller-runtime

Tutte le issue di kubernetes-sigs/controller-runtime

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.