providerinstall

package
v0.2.38 Latest Latest
Warning

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

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

Documentation

Overview

Package providerinstall runs durable Helm installations through Kubernetes Edges. The Job and Helm release live on the selected cluster. The sealed provider Workspace records the plan; neither a browser nor a tenant-authored catalog entry can change the target or chart of a running attempt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupCleanupController

func SetupCleanupController(mgr manager.Manager, installer *Installer) error

SetupCleanupController registers the watch-driven installer cleanup source on the organization manager. The manager's Organization cache discovers one provider-parent Workspace informer per known organization. Those informer handles are transient and owned by this manager's leader term; all cleanup decisions are re-read from the provider Workspace by Installer.

Types

type Installer

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

func New

func New(admin *rest.Config, workspaces WorkspaceAccess, hubURL string, insecure bool) *Installer

func (*Installer) Authorize

func (i *Installer) Authorize(ctx context.Context, org, workspace, edge, user string) error

Authorize checks the caller's permission on this exact Edge before the hub uses its own credential for provisioning. Organization registration policy alone must not confer access to an Edge's Kubernetes API.

func (*Installer) Cleanup

func (i *Installer) Cleanup(ctx context.Context, org, name, job string)

Cleanup removes the expired runner's remaining execution identity after a terminal result is observed. The provider credential remains for its runtime.

func (*Installer) PrepareDelete

func (i *Installer) PrepareDelete(ctx context.Context, org, name string) error

PrepareDelete fences future Start requests and removes only the current attempt's execution identity. It intentionally leaves the provider release, namespace, PVCs, and provider kubeconfig in place for a later registration.

func (*Installer) PrepareDeleteWithUID

func (i *Installer) PrepareDeleteWithUID(ctx context.Context, org, name, expectedOwner string) (string, error)

PrepareDeleteWithUID returns the Workspace UID that was cleaned. Callers pass expectedOwner from an earlier observation when reconciling asynchronous deletion, so a stale reconcile cannot switch to a same-name replacement.

func (*Installer) ReconcileCleanup

func (i *Installer) ReconcileCleanup(ctx context.Context, org, name string) error

ReconcileCleanup persists a terminal Job result before revoking runner credentials and releasing the Job finalizer. It is safe to call repeatedly.

func (*Installer) Start

func (i *Installer) Start(ctx context.Context, org, name string, proposed *Plan, credential []byte, retryFailed bool) (*Status, error)

Start is idempotent while an attempt is active. A retry creates a new Job only after the previous one has failed, using its original pinned recipe.

func (*Installer) Status

func (i *Installer) Status(ctx context.Context, org, name string, ready bool) (*Status, error)

func (*Installer) Target

func (i *Installer) Target(ctx context.Context, org, name string) (*kcp.EdgeRoute, error)

type Plan

type Plan struct {
	Namespace               string         `json:"namespace"`
	Release                 string         `json:"release"`
	Chart                   string         `json:"chart"`
	Version                 string         `json:"version"`
	Values                  map[string]any `json:"values"`
	Org                     string         `json:"org,omitempty"`
	Provider                string         `json:"provider,omitempty"`
	EdgeWorkspaceUUID       string         `json:"edgeWorkspaceUUID,omitempty"`
	EdgeName                string         `json:"edgeName,omitempty"`
	Cluster                 string         `json:"cluster,omitempty"`
	NamespaceAdmissionKnown bool           `json:"namespaceAdmissionKnown,omitempty"`
	NamespaceAdmitted       bool           `json:"namespaceAdmitted,omitempty"`
	NamespaceUID            string         `json:"namespaceUID,omitempty"`
	Job                     string         `json:"job"`
	JobUID                  string         `json:"jobUID,omitempty"`
	Attempt                 int            `json:"attempt"`
	Owner                   string         `json:"owner"`
	AttemptID               string         `json:"attemptID,omitempty"`
	PreparationID           string         `json:"preparationID,omitempty"`
	PreparationExpiresAt    time.Time      `json:"preparationExpiresAt,omitzero"`
	Deleting                bool           `json:"deleting,omitempty"`
	JobResult               string         `json:"jobResult,omitempty"`
	FinishedAt              time.Time      `json:"finishedAt,omitzero"`
	CleanedUp               bool           `json:"cleanedUp,omitempty"`
}

func ResolvePlan

func ResolvePlan(ctx context.Context, in providers.InstallInstructions) (*Plan, error)

ResolvePlan takes only the platform's declared recipe. No shell text, chart URLs, Kubernetes objects, or values supplied by a browser are executed.

type Status

type Status struct {
	Phase     string `json:"phase"`
	Message   string `json:"message"`
	Namespace string `json:"namespace,omitempty"`
	Job       string `json:"job,omitempty"`
	Version   string `json:"version,omitempty"`
	Attempt   int    `json:"attempt,omitempty"`
	CanRetry  bool   `json:"canRetry"`
}

type WorkspaceAccess

type WorkspaceAccess interface {
	GetProviderEdgeRoute(context.Context, string, string) (*kcp.EdgeRoute, error)
	GetChildWorkspaceClusterName(context.Context, string, string) (string, error)
	ChildWorkspaceConfig(string, string) *rest.Config
}

Jump to

Keyboard shortcuts

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