operator: CrashLoopBackOff on startup from an SSA conflict on the platform PackageSource .spec.variants
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go, kubernetes
- Ambito
- backend, infrastructure
Direzione di ricerca
Start at the platform PackageSource apply in cmd/cozystack-operator/main.go near line 311, then trace how its server-side apply options are built. Reproduce the conflict using an object whose .spec.variants is owned by kubectl-client-side-apply. Done means the operator starts successfully with that stale field owner and reaches controller-manager startup.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
After upgrading to v1.7.x, cozystack-operator enters CrashLoopBackOff. It exits during setup, before the controller manager starts:
INFO setup Creating platform PackageSource {"platformSourceName": "cozystack-platform"}
INFO Applying platform PackageSource {"name": "cozystack.cozystack-platform"}
ERROR setup failed to create platform PackageSource {"error": "failed to apply PackageSource cozystack.cozystack-platform: Apply failed with 1 conflict: conflict with \"kubectl-client-side-apply\" using cozystack.io/v1alpha1: .spec.variants"}
main.main
/src/cmd/cozystack-operator/main.go:311
runtime.main
Root cause
The operator applies the platform PackageSource with a server-side apply (field manager cozystack-operator, operation Apply). On clusters where that object's .spec.variants is also owned by a kubectl-client-side-apply manager (operation Update), left over from a kubectl apply done client-side at install time or during an older release, the SSA conflicts. The operator does not set Force: true, so the apply fails and the process exits at cmd/cozystack-operator/main.go:311.
Because the operator never reaches its reconcile loop, no PackageSource is reconciled and no ArtifactGenerator is (re)generated. Already-running workloads keep serving from existing artifacts, but nothing new converges. In our case this surfaced downstream as bucket-*-system HelmReleases failing to render (no template "cozy-lib.ns-host-required", because the bucket-system ArtifactGenerator was never regenerated with the cozy-lib copy rule) and a stalled platform re-reconcile, which made it look like a bundling bug until the operator's own crash was found.
Impact
Any cluster upgrading to v1.7.x whose platform PackageSource.spec.variants was ever touched by a client-side kubectl apply gets a crashlooping operator and a frozen platform reconcile. Running workloads stay up, but nothing reconciles.
Workaround
Drop the stale kubectl-client-side-apply manager from the object, then restart the operator:
# find the index of the kubectl-client-side-apply manager
kubectl -n cozy-system get packagesources.cozystack.io cozystack.cozystack-platform --show-managed-fields -o json \
| jq '.metadata.managedFields | to_entries[] | select(.value.manager=="kubectl-client-side-apply") | .key'
# remove that managedFields entry, then restart the operator
kubectl -n cozy-system patch packagesources.cozystack.io cozystack.cozystack-platform \
--type=json -p='[{"op":"remove","path":"/metadata/managedFields/<index>"}]'
kubectl -n cozy-system rollout restart deploy/cozystack-operator
Suggested fix
Set Force: true on the operator's server-side apply of the platform PackageSource (it is the sole intended owner of that spec), or claim/migrate the kubectl-client-side-apply field manager on upgrade, so the apply cannot be blocked by a stale client-side-apply field owner.
Environment
Upgrade path to v1.7.1, Kube-OVN variant (isp-full), single management cluster.
- Lingua principale
- Go
- Stelle
- 2.2k
- Fork
- 209
- Merge medio
- 4g 14h
- PR unite (30g)
- 140
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cozystack/cozystack
-
triage/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cozystack/cozystack#5464 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
test(kubernetes-nodes): stop hand-typing the default Talos version in tests that are not about itApertaarea/testing kind/cleanup triage/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cozystack/cozystack#5456 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
area/testing kind/cleanup triage/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
cozystack/cozystack#5447 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
area/kubernetes kind/bug triage/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cozystack/cozystack#5445 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
kind/bug triage/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cozystack/cozystack#5438 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di cozystack/cozystack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Correct local module testing instructions for Go sample contributorsForse già presa @slievrly l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8Forse già presa @pacwestnobody l’ha presa oggi. Apertago good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Podiom/Podiom#427 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -raceForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
factory:subtask
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 1 giorno