Help us shape the future of Go! Take the 2026 Go Developer Survey

platform

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentUpgradePolicy added in v0.10.0

type AgentUpgradePolicy struct {
	Enabled bool `json:"enabled"`
}

AgentUpgradePolicy mirrors the controller-owned PlatformConfig spec.agentUpgrades schema. Guest dispatch, artifact verification and fresh inventory are mandatory prerequisites, not policy toggles.

type Config

type Config struct {
	Maintenance    MaintenanceConfig
	FormFieldLocks []FormFieldLock
}

Config holds the resolved platform configuration.

type ConfigProvider

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

ConfigProvider loads and caches the PlatformConfig from Kubernetes.

func NewConfigProvider

func NewConfigProvider(dynamicClient dynamic.Interface) *ConfigProvider

NewConfigProvider creates a new PlatformConfig provider.

func (*ConfigProvider) CreatePlatformConfig

func (p *ConfigProvider) CreatePlatformConfig(ctx context.Context, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)

CreatePlatformConfig creates the PlatformConfig CR.

func (*ConfigProvider) GetAgentUpgradePolicy added in v0.10.0

func (p *ConfigProvider) GetAgentUpgradePolicy(ctx context.Context) (AgentUpgradePolicy, error)

GetAgentUpgradePolicy deliberately bypasses the legacy fail-open/cache path used by maintenance/form configuration. Agent-upgrade admission requires a current policy read; unavailable or malformed configuration never enables the surface. Absent configuration is default-off.

func (*ConfigProvider) GetConfig

func (p *ConfigProvider) GetConfig(ctx context.Context) (*Config, error)

GetConfig returns the current platform configuration, fetching from Kubernetes if needed.

func (*ConfigProvider) GetPlatformConfig

func (p *ConfigProvider) GetPlatformConfig(ctx context.Context) (*unstructured.Unstructured, error)

GetPlatformConfig returns the raw PlatformConfig CR.

func (*ConfigProvider) GetVMExecutionPolicy added in v0.10.0

func (p *ConfigProvider) GetVMExecutionPolicy(ctx context.Context) (VMExecutionPolicy, error)

GetVMExecutionPolicy deliberately bypasses the legacy fail-open/cache path used by maintenance/form configuration. Admission and lease renewal require a current policy read; unavailable or malformed configuration never enables exec.

func (*ConfigProvider) InvalidateCache

func (p *ConfigProvider) InvalidateCache()

InvalidateCache forces the config to be reloaded on next access.

func (*ConfigProvider) UpdatePlatformConfig

func (p *ConfigProvider) UpdatePlatformConfig(ctx context.Context, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)

UpdatePlatformConfig updates the PlatformConfig CR.

type FormFieldLock

type FormFieldLock struct {
	Field   string `json:"field"`
	Value   string `json:"value,omitempty"`
	Message string `json:"message,omitempty"`
}

FormFieldLock defines a locked form field and its enforced value.

type MaintenanceConfig

type MaintenanceConfig struct {
	Enabled bool   `json:"enabled"`
	Message string `json:"message,omitempty"`
}

MaintenanceConfig holds maintenance mode settings.

type VMExecutionPolicy added in v0.10.0

type VMExecutionPolicy struct {
	Enabled       bool `json:"enabled"`
	AllowElevated bool `json:"allowElevated"`
}

VMExecutionPolicy mirrors the controller-owned PlatformConfig schema. Full recording is mandatory and cannot be disabled by this policy.

Jump to

Keyboard shortcuts

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