Webhook server and metrics server use different values to turn off

Aperta
#3,604 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

Start by tracing webhook.Options.Host and Port alongside the metrics, health-probe, and pprof bind-address options. Compare their current defaults and disable behavior, then resolve which compatibility path the project wants. Done means one documented convention is implemented with the stated defaults and deprecation behavior preserved.

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

Descrizione

What

controller-runtime turns its servers off in two different ways:

Server Option Type Turns off with What 0 does
Metrics metricsserver.Options.BindAddress string "0" turns it off
Health probe manager.Options.HealthProbeBindAddress string "0" or "" turns it off
pprof manager.Options.PprofBindAddress string "0" or "" turns it off
Webhook webhook.Options.Port int any value below zero, documented as -1 uses the default 9443

So a project that turns everything off locally passes
--metrics-bind-address=0 --health-probe-bind-address=0 --webhook-port=-1.
Users who expect --webhook-port=0 to work like the other flags get a
webhook server on 9443 instead, with no warning.

Why it matters

It is not homogeneous, which makes it very difficult and confusing for end users. Ideally, everything should work in the same way.
Having a clear convention here would be very helpful in reducing confusion and avoiding misleading behavior.

Why the webhook server cannot use 0 as it is

webhook.Options.Port is an int, and 0 is its zero value, so an unset portis 0. If 0 turned the server off, every caller that relies on the default 9443 would silently stop serving webhooks which can be harder yet for end users.

Proposal

Use one format for every server: replace the webhook server's Host and Port
with a BindAddress, the same option the metrics server and the health probe
already have.

  • add webhook.Options.BindAddress: "0" turns the webhook server off, and any
    other value is the address to listen on, such as :9443;
  • deprecate Host and Port in the same release, and remove them in a later
    one. Until then, Port < 0 keeps turning the server off and an unset
    BindAddress keeps today's default, :9443, so nothing breaks;
  • document the rule once for all servers: "0" turns the server off.

If replacing Port is too large a change, an alternative is to make it a
*int, so that an unset port keeps the default 9443 and 0 turns the server
off, matching the other servers.

Lingua principale
Go
Stelle
3k
Fork
1.3k
Merge medio
1g 7h
PR unite (30g)
48

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 kubernetes-sigs/controller-runtime

Tutte le issue di kubernetes-sigs/controller-runtime

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.