apiresourceschema

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package apiresourceschema contains a controller that watches for PublishedResources and creates a matching APIResourceSchema (ARS) in kcp. The name of the generated ARS is stored in the PublishedResource's status, so that the apiexport controller can find and include it in the generated APIExport.

The ARS name contains a hash over the GVK that the PublishedResource is pointing to. This is to ensure that if an PublishedResource is created, then deleted, modified with an editor and re-applied, it won't turn into the same ARS, as we cannot simply turn an ARS for a Pod into an ARS for a StorageClass.

There is no extra cleanup procedure in either of the clusters when a PublishedResource is deleted. This is to prevent accidental data loss in kcp in case a service owner accidentally (and temporarily) removed a PublishedResource.

Index

Constants

View Source
const (
	ControllerName = "syncagent-apiresourceschema"
)

Variables

This section is empty.

Functions

func Add

func Add(
	mgr manager.Manager,
	kcpCluster cluster.Cluster,
	lcName logicalcluster.Name,
	log *zap.SugaredLogger,
	numWorkers int,
	agentName string,
	apiExportName string,
	prFilter labels.Selector,
) error

Add creates a new controller and adds it to the given manager.

Types

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL