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

未关闭
#3,445 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
4

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

istio/api 的其他 Issue

查看 istio/api 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。