Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feature: mutate spec object references for other published resources

Aperta
#23 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
go, kubernetes

Direzione di ricerca

Inizia con l’API PublishedResources e la fase di mutazione riabilitata in #19. Traccia come sono rappresentate le regole di ridenominazione per le risorse pubblicate e come potrebbe essere identificato un riferimento come spec.configRef.name. Il lavoro è completo quando l’API può dichiarare la risorsa di destinazione e gli oggetti sincronizzati usano il nome tradotto per le risorse referenziate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/feature
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

Lingua principale
Go
Stelle
25
Fork
29
Merge medio
5g 18h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kcp-dev/api-syncagent

Tutte le issue di kcp-dev/api-syncagent

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.