feat(upgrade): pre-upgrade guard against downgrades

Aperta
#219 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go, kubernetes

Direzione di ricerca

Read the talm upgrade path and its post-upgrade verification code to find the upgrade RPC call and the COSI version reader; the issue does not name file paths or tests. Trace how the target image tag and --insecure are handled, then check existing CLI flag and error conventions. Done means older major.minor targets are blocked with a useful hint unless explicitly overridden, while insecure mode skips the guard.

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

Descrizione

area/commands area/upgrade kind/feature

Problem

talm upgrade fires the upgrade RPC without comparing the running Talos version against the target parsed from the image tag. If values.yaml::image is older than what the node runs (stale preset default, mistaken edit), talm silently initiates a downgrade. Talos does not support downgrades across minor versions; the result ranges from an A/B rollback to a broken node. The post-upgrade verify only compares running vs target after the fact — a "successful" downgrade passes it (running == target at major.minor), and the write-back then pins the node file to the older image.

Concrete shape of the trap: a project initialized with an old preset has image: ...talos:v1.10.5 in values.yaml, nodes run v1.12.6, and talm upgrade -f nodes/node1.yaml resolves v1.10.5 and would downgrade without any warning.

Proposal

Before invoking the upgrade RPC, read the running version (same COSI reader as the post-upgrade verify) and compare major.minor against the target tag. If the target is older than the running version, block with a hint-bearing error; allow override with an explicit flag (e.g. --allow-downgrade). Skip the guard on --insecure (no authenticated COSI path), mirroring the post-upgrade verify predicate.

Related: #213 (version-skew gates).

Lingua principale
Go
Stelle
493
Fork
23
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 cozystack/talm

Tutte le issue di cozystack/talm

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.