catalogmigration

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package catalogmigration converts standalone legacy MCP resources to vMCPs before controllers and API traffic start.

Index

Constants

View Source
const (
	// MigrationName is the durable gateway marker and part of the stable destination IDs.
	MigrationName = "standalone_mcp_to_vmcp"

	// OwnerProfileName grants a workspace owner access to its shared resources.
	OwnerProfileName = "owner"
)

Variables

This section is empty.

Functions

func AppendRuleProfile

func AppendRuleProfile(profiles []types.VMCPProfile, rule v1.AccessControlRule) []types.VMCPProfile

AppendRuleProfile grants a rule's subjects every component. A rule without subjects grants no one access, so it adds no profile. Profiles are named for the rule's display name; the rule name is used when the display name is empty, already taken, or reserved for the workspace owner. Duplicate profile names fail validation and abort the migration, so a taken rule name is suffixed.

func Cleanup

func Cleanup(ctx context.Context, client kclient.Client) error

Cleanup runs on every startup after the one-time migration has succeeded. Keep finalizers so normal controller cleanup can retire credentials/runtimes.

func MigrateFilters

func MigrateFilters(ctx context.Context, client kclient.Client, namespace string, targets, sources []types.Resource, catalogs []string) error

MigrateFilters replaces direct legacy references while retaining catalog and wildcard scopes, which still apply to other resources. Retries also remove sources from filters that already contain a destination.

Types

type Handler

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

func New

func New(client *gateway.Client, syncCatalog func(context.Context, kclient.ObjectKey) error) *Handler

New creates the migration handler. syncCatalog, when set, synchronizes an MCPCatalog from its sources before the migration snapshots its entries.

func (*Handler) MigrateAll

func (h *Handler) MigrateAll(ctx context.Context, client kclient.Client) error

MigrateAll retains sources until the caller records successful completion. Stable destination IDs allow a failed startup to retry without duplicating objects.

Jump to

Keyboard shortcuts

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