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

オープン
#3,445 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go
領域
api, networking

調査の方向性

destination_rule.proto の ConsistentHashLB メッセージから始め、そこにある int64/uint64 フィールドが生成された CRD でどのように表現されているかを追跡します。Kubernetes client-go でリソースを作成して問題を再現し、API server のバリデーションエラーを調査します。報告された型バリデーションエラーなしで対象の CRD リソースを作成できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
523
フォーク
623
平均マージ
5日 20時間
マージ済み PR(30日)
4

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

istio/api のほかの issue

istio/api の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。