kubernetes 生成的 ApplyConfiguration 无法正确处理字节切片

r3i60tvu  于 2个月前  发布在  Kubernetes
关注(0)|答案(6)|浏览(40)

发生了什么?
[]byte 中的切片在生成的 apply 配置代码中没有正确处理
kubernetes/staging/src/k8s.io/client-go/applyconfigurations/admissionregistration/v1/webhookclientconfig.go
第54行到第59行
| | func (b*WebhookClientConfigApplyConfiguration) WithCABundle(values...byte) *WebhookClientConfigApplyConfiguration { |
| | fori:=rangevalues { |
| | b.CABundle=append(b.CABundle, values[i]) |
| | } |
| | returnb |
| | } |
我期望发生什么?
我期望字节切片被分配给属性
eg.

// WithCABundle adds the given value to the CABundle field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the CABundle field.
func (b *WebhookClientConfigApplyConfiguration) WithCABundle(value []byte) *WebhookClientConfigApplyConfiguration {
	b.CABundle = value
	return b
}

我们如何尽可能精确地最小化地重现它?
查看代码生成器
还需要了解其他信息吗?

  • 无响应*

Kubernetes版本
所有版本
云提供商
N/A
操作系统版本

  • 无响应*

安装工具

  • 无响应*

容器运行时(CRI)和版本(如适用)

  • 无响应*
2cmtqfgy

2cmtqfgy3#

是的,算法是我们将元素添加到列表中,但我同意对于[]byte来说这没有意义。希望[]byte始终被视为原子。实际上,我们可能应该将原子列表与非原子(替换与追加)区分对待。

s5a0g9ez

s5a0g9ez4#

你对这里有任何意见或记得某件具体的事情吗?

pdsfdshx

pdsfdshx5#

将任务分配给 @siyuanfoundation

相关问题