uint64/int64 fields in Istio CRDs cannot be set via apimachinery

Aperta
#3,445 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
api, networking

Direzione di ricerca

Inizia dal messaggio ConsistentHashLB in destination_rule.proto e segui come i suoi campi int64/uint64 sono rappresentati nella CRD generata. Riproduci il problema creando la risorsa con Kubernetes client-go e analizza l’errore di validazione dell’API server. Il lavoro è completato quando la risorsa CRD interessata può essere creata senza l’errore di validazione del tipo segnalato.

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

Descrizione

area/user experience

Bug description
If a CRD defined via protobuf contains a primitive int64/uint64 field, it will be impossible to set using kubernetes client-go. The API server will log a validation error along these lines:

spec.subsets[0].trafficPolicy.loadBalancer.consistentHash.maglev.tableSize: Invalid value: "string": spec.subsets[0].trafficPolicy.loadBalancer.consistentHash.maglev.tableSize in body must be of type integer: "string""

Affected product area (please put an X in all that apply)

[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[x] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[x] User Experience

Expected behavior
The expected behavior is that the resource will be created without API errors.
I would suggest either of the following solutions:

  • Add the cue-gen:DestinationRule:intOrString:xxx option
  • Change the uint64 to uint32 in the destination_rule.proto file, specifically in the ConsistentHashLB message:
message ConsistentHashLB {

  message RingHash {
    // The minimum number of virtual nodes to use for the hash
    // ring. Defaults to 1024. Larger ring sizes result in more granular
    // load distributions. If the number of hosts in the load balancing
    // pool is larger than the ring size, each host will be assigned a
    // single virtual node.
    uint32 minimum_ring_size = 1;
  };

  message MagLev {
    // The table size for Maglev hashing. This helps in controlling the
    // disruption when the backend hosts change.
    // Increasing the table size reduces the amount of disruption.
    // The table size must be prime number less than 5000011.
    // If it is not specified, the default is 65537.
    uint32 table_size = 1;
  };

  ...
}

Steps to reproduce the bug

  1. Define a CRD using protobuf that includes primitive int64 or uint64 fields.(e.g. tableSize field of DestinationRule)
  2. Attempt to create an instance of this CRD using kubernetes client-go.
  3. Observe the validation error in the API server logs.

Version (include the output of istioctl version --remote and kubectl version)

  • istioctl version --remote: 1.16.1
  • kubectl version: v1.25.2

How was Istio installed?
istioctl

Environment where bug was observed (cloud vendor, OS, etc)

MacOS sequoia v15.1.1

Additionally, please consider attaching a cluster state archive by attaching
the dump file to this issue.

Lingua principale
Go
Stelle
523
Fork
623
Merge medio
5g 20h
PR unite (30g)
4

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 istio/api

Tutte le issue di istio/api

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.