feature: mutate spec object references for other published resources
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 ·
-
kind/feature
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
kcp-dev/api-syncagent#186 · リアクション 1 件 ·
-
kind/bug
kcp-dev/api-syncagent#182 · コメント 1 件 · 担当者 1 名 ·
-
bug: finalizer "syncagent.kcp.io/cleanup" on related resources block deletion of primary object オープンkind/bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
kcp-dev/api-syncagent#172 · コメント 1 件 · リアクション 1 件 ·
kcp-dev/api-syncagent の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
acceptance-tests phase-coding schema-coverage testing triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100