DECK_SKIP_DEFAULTS_FILL: nested blocks such as upstream healthchecks must be written in full

Aperta
#2,311 0 commenti 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
56/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
devtools

Direzione di ricerca

Start by tracing how DECK_SKIP_DEFAULTS_FILL affects defaults and nested field comparison in deck gateway diff, using the minimal kong.yaml configuration and expected versus actual diff in the issue as the reproduction. Check the diff tests around upstream healthchecks and add coverage for a partial passive block. Done means sync followed by diff reports no changes for this case, or the behavior and documentation are clarified if skipping defaults is intended to require full nested blocks.

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

Descrizione

With DECK_SKIP_DEFAULTS_FILL=true (the workaround suggested in #2199 for the redis-ee partial drift), an upstream that declares only part of its healthchecks block is reported as changed on every deck gateway diff / sync, even right after a successful sync.

Konnect stores the full healthchecks tree (active, passive, threshold) with Kong's defaults. Since decK no longer fills defaults before diffing, the omitted nested fields are compared against the values Konnect returns.

Minimal configuration:
kong.yaml:

_format_version: "3.0"
services:
  - name: example-service
    host: example-upstream
    port: 443
    protocol: https
upstreams:
  - name: example-upstream
    healthchecks:
      passive:
        type: https
    targets:
      - target: backend.example.com:443 

With DECK_SKIP_DEFAULTS_FILL=true, deck gateway sync kong.yaml followed by deck gateway diff kong.yaml should report no changes, but it reports an update on example-upstream, every time.

Actual:
DecK lists every healthchecks field that Konnect stores but the file does not declare as a - line, i.e. a field it would remove (output shortened, the long lists of HTTP status codes are replaced by { ... }):

updating upstream example-upstream  {
   "healthchecks": {
-    "active": {
-      "concurrency": 10,
-      "healthy": {
-        "http_statuses": [200, 302],
-        "interval": 0,
-        "successes": 0
-      },
-      "http_path": "/",
-      "https_verify_certificate": true,
-      "timeout": 1,
-      "type": "http",
-      "unhealthy": { ... }
-    },
     "passive": {
-      "healthy": { ... },
       "type": "https",
-      "unhealthy": {
-        "http_failures": 0,
-        "http_statuses": [429, 500, 503],
-        "tcp_failures": 0,
-        "timeouts": 0
-      }
     },
-    "threshold": 0
   },
   "id": "...",
   "name": "example-upstream"
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0

Workaround:
Write the whole healthchecks block that Konnect stores (active with both intervals at 0, passive healthy/unhealthy statuses, threshold 0). With the same DECK_SKIP_DEFAULTS_FILL=true, the next diff then reports Created: 0, Updated: 0, Deleted: 0. This means every default of the block has to be spelled out in the state file, and kept in line with Kong's defaults across upgrades.

Question:
Is this the intended behaviour of skipping the defaults fill? If so, could the docs for DECK_SKIP_DEFAULTS_FILL say that nested blocks must then be written in full? If not, should decK ignore omitted nested fields when the defaults fill is skipped?

Related to #2199

Environment:
decK version: 1.69
Konnect control plane (EU region, https://eu.api.konghq.com), type: [Hybrid, from Gateway Manager]

Lingua principale
Go
Stelle
507
Fork
142
Merge medio
1g 15h
PR unite (30g)
9

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 Kong/deck

Tutte le issue di Kong/deck

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.