Dashboard order form: a dropdown set to None gets its default option back after a YAML round trip

Aperta
#5,473 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
frontend

Direzione di ricerca

The issue identifies DynamicOptionsWidget, its useRef state, and the order page's formContext; start by tracing how the form switches between YAML and Form tabs and how Retry and tenant changes reset context. Follow the existing default resolution for the storageclass option source. Done when a user-selected empty value survives the round trip and Deploy sends "", while an unresolved server default still selects the cluster default.

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

Descrizione

area/dashboard kind/bug triage/needs-triage
Describe the bug

On the application order page with installation defaults (#5107), a dynamic dropdown (x-cozystack-options) set to None is written as "", which should win over the installation default. After switching to the YAML tab and back to the form, the dropdown shows its default option again and Deploy stores that option instead of "". Same happens to "" written in the YAML tab.

Environment
  • Cozystack: main (since #5107)
  • Dashboard order page in defaulting="server" mode
To Reproduce
  1. Set applicationDefaults with a storageClass for an application that uses the storageclass option source.
  2. Open its order page, the preview fills storageClass from the defaults.
  3. Pick None in the dropdown, the YAML tab shows storageClass: ''.
  4. Go back to the Form tab.
Expected behaviour

Dropdown stays empty and Deploy sends storageClass: "".

Actual behaviour

Dropdown shows the option marked default (cluster default StorageClass) and Deploy sends its name.

Additional context

DynamicOptionsWidget keeps "already auto-defaulted" in a useRef, so the remount on editor switch resets it. In server mode it selects the default item for "" on purpose: dry-run returns chart defaults like storageClass: "" and the form should show the cluster default class. The widget can't tell that "" from one the user chose, so the fix needs the order page to remember which fields were already resolved (through formContext, reset on Retry and tenant switch).

Only the storageclass source marks a default item today, and "" resolves to the same class at create time, so the difference is the stored value (local instead of ""), which keeps the application on that class if the cluster default changes later.

Lingua principale
Go
Stelle
2.2k
Fork
209
Merge medio
4g 14h
PR unite (30g)
140

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

Tutte le issue di cozystack/cozystack

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.