Unable to conversion-gen conversions that require a conversion.Scope
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 issue 中显示的 conversion-gen 输出,以及转换机制所使用的 conversion.Scope 实现。然后检查 ConvertTo 和 ConvertFrom 实现应如何访问 Scope,同时检查 code-generator issue 94 中描述的限制。当确定了一种受支持的方式来使用需要 Scope 的生成转换,或记录不存在此类路径时,即可视为完成。
由索引模型根据 Issue 内容生成。
描述
Some functions autogenerated by conversion-gen produce code that looks like this:
func autoConvert_v1alpha1_Something_To_v1alpha2_Something(in *Something, out *v1alpha2.Something, s conversion.Scope) error {
// normal convertible fields
out.X = in.X
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.SomeField, &out.SomeField, 0); err != nil {
return err
}
return nil
}
The "inefficient conversion" can happen in a few different situations; in this case, it's because SomeField is a struct that lives in a package outside of the one where I'm generating conversions. Due to https://github.com/kubernetes/code-generator/issues/94 (assuming there isn't a workaround), even if there were conversion functions for SomeField, conversion-gen isn't able to see & use them.
We presumably need access to a conversion.Scope in our ConvertTo/ConvertFrom implementations, but these are member functions on the types, and I haven't yet found any way to get access to a Scope (this appears to have a single, unexported implementation that is used internally by the conversion machinery code).
Anyone know of a way to use generated conversion functions that need a Scope?
- 主要语言
- Go
- 星标
- 3k
- 派生
- 1.3k
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 48
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kubernetes-sigs/controller-runtime 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
kubernetes-sigs/controller-runtime#3704 ·
维护者通常 1 天内回复
-
lifecycle/rotten
难度 2/5 1-3 小时 新手友好度 78/100
kubernetes-sigs/controller-runtime#3537 · 4 条评论 ·
维护者通常 1 天内回复
-
Read-your-writes consistency is not applied to unstructured objects written with Update or Patch可能已有人在做 @7616e5a9c573ffb221843a498885ab0f 于 1 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 25/100
kubernetes-sigs/controller-runtime#3702 ·
维护者通常 1 天内回复
-
Client and DynamicRESTMapper keep a kind's old scope after its CRD is recreated with a different `scope`可能已有人在做 @AdamMagued 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
kubernetes-sigs/controller-runtime#3671 ·
维护者通常 1 天内回复
-
ReadYourWrite doesn't correctly deal with mutating requests removing the last finalizer可能已有人在做 @AdamMagued 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 28/100
kubernetes-sigs/controller-runtime#3670 · 1 个 reaction ·
维护者通常 1 天内回复
查看 kubernetes-sigs/controller-runtime 的全部 Issue
相似的 Issue
-
Task retarget keeps the old host in task scope and adds the new host in a form that matches nothing可能已有人在做 @chaitanya0305 今天认领。 未关闭bug P2
难度 2/5 1-3 小时 新手友好度 62/100
BaaRai/ARTEX#652 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
compiler-explorer/compiler-explorer#9710 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 65/100
losisin/helm-values-schema-json#437 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复