registry

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package registry owns routing for the registry top-level command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultGitTag

func DefaultGitTag() string

func DeployRegistry

func DeployRegistry(logger *zap.Logger, namespace string, port int, registryType, registryStorageSize, manifestPath string) error

func EnableNativeAuthForSetup

func EnableNativeAuthForSetup(ctx context.Context, opts SetupNativeAuthOptions) error

EnableNativeAuthForSetup activates native registry authentication as the final setup step. It uses a cluster-held administrator key instead of a CLI login and accepts a bundled broker image, because setup always publishes platform-api to the bundled registry. An already active registry is left unchanged; rotate node credentials with registry enable-auth.

func NativeAuthActive

func NativeAuthActive(ctx context.Context, cs kubernetes.Interface) (bool, error)

NativeAuthActive reports whether the bundled registry already enforces Distribution token authentication.

func New

func New(runtime *core.Runtime) *cobra.Command

New returns the registry command.

func NewWithManager

func NewWithManager(mgr *RegistryManager) *cobra.Command

NewWithManager returns the registry command using the provided manager.

func PreserveNativeRegistryManifest

func PreserveNativeRegistryManifest(ctx context.Context, cs kubernetes.Interface, namespace, manifest string) (string, error)

PreserveNativeRegistryManifest retains native authentication during setup reapplication.

func PublicImageRefForSavedLogin

func PublicImageRefForSavedLogin(image string) (string, bool)

PublicImageRefForSavedLogin rewrites an image ref whose registry is a local placeholder (registry.local) or the bundled in-cluster registry Service DNS name onto the registry host of the active platform login. Neither host is pullable by a remote platform's nodes, so deploys through the platform API must name the registry the user pushed to. It returns false when the ref names another registry or no platform login registry is known (e.g. a Kind test-mode login against localhost), leaving the ref unchanged.

func ResolveExternalRegistryConfig

func ResolveExternalRegistryConfig(flagCfg *config.ExternalRegistryConfig) (*config.ExternalRegistryConfig, error)

func ResolveInternalPlatformRegistryURL

func ResolveInternalPlatformRegistryURL(logger *zap.Logger) string

func ResolvePlatformRegistryURL

func ResolvePlatformRegistryURL(logger *zap.Logger) string

func RunAdminRegistryPush

func RunAdminRegistryPush(ctx context.Context, mgr *RegistryManager, image, registryURL, name, scope, mode, helperNamespace string) error

RunAdminRegistryPush pushes an image using direct Kubernetes access for operator debugging. Normal users should use server push instead.

func RunRegistryProvision

func RunRegistryProvision(mgr *RegistryManager, url, username, password, operatorImage string, dryRun bool) error

RunRegistryProvision contains the registry provision command flow for folder packages.

func RunRegistryPush

func RunRegistryPush(ctx context.Context, mgr *RegistryManager, image, registryURL, name, scope string) error

RunRegistryPush pushes an image through the platform API.

func SavedLoginRegistryHost

func SavedLoginRegistryHost() string

SavedLoginRegistryHost returns the registry host tied to the active platform login: the registry host saved by auth login, else one derived from the saved platform API URL (platform.<domain> -> registry.<domain>). It returns "" for logins against localhost or when no login is saved.

func ScopedRegistryRepository

func ScopedRegistryRepository(ctx context.Context, client *platformapi.PlatformClient, repo string, scope topology.Scope) (string, error)

ScopedRegistryRepository applies the repository prefix implied by a publish scope.

Types

type RegistryManager

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

RegistryManager handles registry operations with injected dependencies.

func DefaultRegistryManager

func DefaultRegistryManager(logger *zap.Logger) *RegistryManager

DefaultRegistryManager returns a RegistryManager using default clients.

func NewRegistryManager

func NewRegistryManager(kubectl *core.KubectlClient, exec core.Executor, logger *zap.Logger) *RegistryManager

NewRegistryManager creates a RegistryManager with the given dependencies.

func (*RegistryManager) CheckRegistryStatus

func (m *RegistryManager) CheckRegistryStatus(namespace string) error

CheckRegistryStatus checks and displays registry status.

func (*RegistryManager) LoginRegistry

func (m *RegistryManager) LoginRegistry(registryURL, username, password string) error

LoginRegistry logs into a container registry.

func (*RegistryManager) PushDirect

func (m *RegistryManager) PushDirect(source, target string) error

PushDirect pushes an image directly using docker.

func (*RegistryManager) PushInCluster

func (m *RegistryManager) PushInCluster(source, target, helperNS string) error

PushInCluster pushes an image using an in-cluster helper pod.

func (*RegistryManager) PushViaPlatform

func (m *RegistryManager) PushViaPlatform(ctx context.Context, client *platformapi.PlatformClient, source, target, scope string) error

PushViaPlatform saves the local image and asks the platform API to push it in-cluster.

func (*RegistryManager) SetNativeAuthClient

func (m *RegistryManager) SetNativeAuthClient(client kubernetes.Interface)

SetNativeAuthClient binds publication auth discovery to an explicitly selected cluster. Callers that do not select a client retain the registry CLI default.

func (*RegistryManager) ShowRegistryInfo

func (m *RegistryManager) ShowRegistryInfo() error

ShowRegistryInfo displays registry connection information.

type SetupNativeAuthOptions

type SetupNativeAuthOptions struct {
	// Realm is the public HTTPS token URL ending /api/v1/registry/token.
	Realm string
	// APIBaseURL is the public platform API origin used for credential issuance.
	APIBaseURL string
	// APIKey is a platform administrator service key read from the cluster.
	APIKey string
}

SetupNativeAuthOptions configures activation performed by setup.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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