bootstrap

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package bootstrap installs the kcp-side objects the marketplace needs: the three APIExports and their endpoint slices, the producer WorkspaceType, and the two hand-bound tiers (catalog and producers parent).

Workspace-path plumbing is shared with the access component (access/pkg/bootstrap); this package only owns the marketplace assets.

Index

Constants

View Source
const (
	// ExportCatalog serves Producers in the catalog workspace.
	ExportCatalog = "marketplace-catalog"
	// ExportPublish serves no resources; it carries the claims the publish
	// flow needs in producer workspaces, with the
	// publish-side claims.
	ExportPublish = "marketplace-publish"
	// ExportProvisioner grants the claim to create producer workspaces.
	ExportProvisioner = "marketplace-provisioner"
)

The three exports. Each has an endpoint slice of the same name, and the operator runs one manager (or holds one client) per slice. Nothing is exported into consumer workspaces: enabling is a plain kcp APIBinding the consumer creates, so the marketplace has no footprint there.

View Source
const (
	DefaultWorkspacePrefix      = "root:marketplace"
	DefaultControllersWorkspace = "controllers"

	// DefaultCatalogWorkspace is the registry: the workspace Producer
	// records live in. Deliberately not the workspace producers are
	// provisioned under.
	DefaultCatalogWorkspace = "catalog"

	// DefaultProducersWorkspace is the provisioning parent: every
	// provisioned producer workspace is created as its child. It holds no
	// marketplace objects at all.
	DefaultProducersWorkspace = "producers"
)

Defaults for where things are installed.

View Source
const (
	WorkspaceTypeProvider = "producer"
)

The workspace type the operator provisions producer workspaces with. It deliberately does not extend root:universal, so a producer workspace serves apis.kcp.io and the kcp built-ins but neither tenancy.kcp.io nor topology.kcp.io.

Variables

This section is empty.

Functions

func BindCatalog

func BindCatalog(ctx context.Context, cfg *rest.Config, result *Result, opts Options) error

BindCatalog makes the workspace cfg points at the Producer registry: it binds marketplace-catalog, then waits until Producers are servable.

func BindProvidersParent

func BindProvidersParent(ctx context.Context, cfg *rest.Config, result *Result, opts Options) error

BindProvidersParent makes the workspace cfg points at the provisioning parent: it binds marketplace-provisioner, so producer workspaces can be created as its children. Nothing to wait for — the claim adds reach, not a servable API.

func GrantPlatformAdmins

func GrantPlatformAdmins(ctx context.Context, cfg *rest.Config, users, groups []string) error

GrantPlatformAdmins makes the given identities administrators of the Producer registry cfg points at: they may enter it and manage Producers, and nothing else. It is applied even with no identities, so that dropping someone from the list revokes them.

func WaitForEndpointSliceURLs

func WaitForEndpointSliceURLs(ctx context.Context, cfg *rest.Config, sliceName string) ([]string, error)

WaitForEndpointSliceURLs reports the virtual workspace URLs one endpoint slice has published, nudging first. An empty answer is informational, never fatal.

Types

type Options

type Options struct {
	// ServerUsers and ServerGroups are additional identities granted the
	// server role in the exports workspace — the identities the operator
	// and the virtual workspace authenticate as when they are not this
	// bootstrap's own credential.
	ServerUsers  []string
	ServerGroups []string
}

Options configures Bootstrap.

type Result

type Result struct {
	// ExportsPath is the canonical path of the workspace holding the
	// exports, and ExportsCluster its logical cluster name.
	ExportsPath    string
	ExportsCluster string
	// WorkspacesIdentityHash is the identity of kcp's tenancy.kcp.io
	// export, which every claim on `workspaces` must repeat.
	WorkspacesIdentityHash string
}

Result reports what Bootstrap installed.

func Bootstrap

func Bootstrap(ctx context.Context, cfg *rest.Config, exportsPath string, opts Options) (*Result, error)

Bootstrap applies the exports workspace's assets into the workspace cfg points at. Idempotent: safe to run on every pod start and every upgrade.

Jump to

Keyboard shortcuts

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