feature: mutate spec object references for other published resources
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- go, kubernetes
调研方向
从 PublishedResources API 以及在 #19 中重新启用的 mutation 阶段开始。跟踪已发布资源的重命名规则是如何表示的,以及如何识别诸如 spec.configRef.name 这样的引用。完成的标准是 API 能够声明目标资源,并且同步对象对被引用的资源使用转换后的名称。
由索引模型根据 Issue 内容生成。
描述
Feature Description
For namespaced resources, syncing from kcp to a Kubernetes cluster (3D space to 2D space, in a way) is usually not a problem because our default resource renaming rules put everything under its own namespace, so e.g. related resources such as Secrets do not create problems with their naming (a secretRef in an object pointing to my-secret is not creating conflicts because everything will happen in a generated namespace of the format WORKSPACE-NAMESPACE [with hashes, but you get the idea]).
This is however not possible with cluster-scoped resources in general, plus referencing other published resources would also create similar problems. Think of the following manifests that I want to create in kcp with both being synced down to a service provider cluster:
apiVersion: service/v1
kind: Config # a cluster-scoped resource
metadata:
name: my-config
spec: {}
---
apiVersion: service/v1
kind: ServiceInstance # a namespace-scoped resource
metadata:
name: my-instance
namespace: my-namespace
spec:
configRef:
name: my-config # a reference to my Config object from above
What is needed is a way to describe object references like this (basically say: spec.configRef.name in the ServiceInstance kind is a reference to another resource that is within the realm of the api-syncagent) in PublishedResources.
Since the api-syncagent knows about the renaming rules of other resources published via PublishedResources, it should mutate spec.configRef.name to the name that it translated the my-config object to. So on the service provider side, these objects should look somewhat like this:
apiVersion: service/v1
kind: Config # a cluster-scoped resource
metadata:
name: iuc6yffea77crveb-7505d64a54e061b7acd5
spec: {}
---
apiVersion: service/v1
kind: ServiceInstance # a namespace-scoped resource
metadata:
name: my-instance
namespace: org-ucdyfdsa7trvfa-sdadsjdjwwewads
spec:
configRef:
name: iuc6yffea77crveb-7505d64a54e061b7acd5 # a reference to my Config object from above
Proposed Solution
I'm not fully clear on how the API should look, but most likely a PublishedResource should have a way to mark object references and define what resource is being referenced here. The api-syncagent would need to hold an internal representation of all renaming rules depending on resources, and would then use those rules in the mutation phase we recently re-enabled in #19.
Alternative Solutions
No response
Want to contribute?
- I would like to work on this issue.
Additional Context
No response
- 主要语言
- Go
- 星标
- 25
- 派生
- 30
- 平均合并
- 5 天 18 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kcp-dev/api-syncagent 的其他 Issue
-
kind/bug
难度 2/5 1-3 小时 新手友好度 74/100
kcp-dev/api-syncagent#163 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
kcp-dev/api-syncagent#161 ·
-
bug: failed sync controller prevents subsequent startup retries可能已有人在做 @Sarthak-Shreshtha01 于 2 天前认领。 未关闭kind/bug
难度 3/5 1-2 天 新手友好度 20/100
kcp-dev/api-syncagent#190 · 1 条评论 ·
-
bug: dangling schema in an APIExport is neither removed nor reported可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
kcp-dev/api-syncagent#188 · 1 条评论 ·
-
kind/feature
难度 4/5 3-5 天 新手友好度 48/100
kcp-dev/api-syncagent#186 · 1 条评论 · 1 个 reaction ·
查看 kcp-dev/api-syncagent 的全部 Issue
相似的 Issue
-
bug triage
难度 2/5 1-3 小时 新手友好度 62/100
FairwindsOps/nova#484 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
automated-analysis code-quality cookie
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
[otelcol] print-config help text still requires the removed otelcol.printInitialConfig feature gate可能已有人在做 @girishkvs 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
open-telemetry/opentelemetry-collector#16143 · 1 条评论 ·
维护者通常 1 天内回复
-
bug good first issue load-balancing
难度 2/5 1-3 小时 新手友好度 82/100
ktrubilo9/edge-proxy#53 ·