Condition rule form drops routes that specify only a destination

Aperta Adatta ai principianti
#1,658 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 8 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, typescript

Direzione di ricerca

Inizia da mergeConditions() in ui-vue3/src/views/traffic/routingRule/composables/useRoutingRule.ts ed esamina il test del componente correlato di PR #1650. Controlla come vengono serializzate le righe con una corrispondenza della richiesta vuota ma con una destinazione, poi verifica che il corpo del POST in uscita mantenga quella condizione mentre una riga completamente vuota venga ignorata. L’esempio in instance.go mostra il formato della condizione che contiene solo una destinazione.

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

Descrizione

The condition routing form drops a route when the user sets a destination and leaves the request match empty. This prevents the form from expressing a route that applies to every request. A component test on PR #1650 at 3a724901 reproduced the payload below. The same serialization code is present on develop at 62d15aff.

Steps to reproduce
  1. Open the condition rule creation form, choose application scope, and enter an application name such as demo-server.
  2. Leave the request match empty. In the route destination, select host, choose =, and enter 10.0.0.1.
  3. Click Confirm and inspect conditions in the outgoing POST body.

Actual: The form sends "conditions": []. If other rows have request matches, those rows are retained and the destination-only row is silently omitted.

Expected: The payload contains a condition equivalent to =>host=10.0.0.1, so the destination filter applies to every request. A completely empty row can still be skipped. Admin already generates destination-only conditions such as =>host!=<IP> when disabling traffic to an instance.

mergeConditions() only appends rows with a nonempty request match · Backend example

Related to #1648 and #1650. The omission is visible in the request body before the server validates the rule name.

Lingua principale
Go
Stelle
4.1k
Fork
2.2k
Merge medio
6g 2h
PR unite (30g)
4

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 apache/dubbo-admin

Tutte le issue di apache/dubbo-admin

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.