Documentation
¶
Index ¶
- Variables
- func KonfluxOperatorImage(config *Config) string
- func OperatorBundleImage(config Config) string
- func ParseFeatureFlags(flags []string) (map[string]bool, error)
- func ParseOperatorEnvVar(envExpr string) (string, string, error)
- func PopulateKonfluxEnvVars(config *Config)
- type CentralConfig
- func (c *CentralConfig) ConfigureSpec(roxieConfig *RoxieConfig) error
- func (c *CentralConfig) CustomResource() (map[string]interface{}, error)
- func (c *CentralConfig) EarlyReadinessEnabled() bool
- func (c *CentralConfig) EarlyReadinessSet() bool
- func (c *CentralConfig) ExposureEnabled() bool
- func (c *CentralConfig) ExposureSet() bool
- func (c *CentralConfig) GetExposure() types.Exposure
- func (c *CentralConfig) GetWaitConfig() WaitConfig
- func (c *CentralConfig) PauseReconciliationEnabled() bool
- func (c *CentralConfig) PauseReconciliationSet() bool
- func (c *CentralConfig) PortForwardingEnabled() bool
- func (c *CentralConfig) PortForwardingSet() bool
- type Config
- type Deployer
- func (d *Deployer) Cleanup()
- func (d *Deployer) Deploy(ctx context.Context, components component.Component) error
- func (d *Deployer) GetCentralDeploymentInfo() types.CentralDeploymentInfo
- func (d *Deployer) GetContainerRuntimeSocket() string
- func (d *Deployer) GetKubeContext() string
- func (d *Deployer) GetPreLoaderForCluster() (ImagePreLoader, error)
- func (d *Deployer) PrintCentralDeploymentSummary()
- func (d *Deployer) PrintSecuredClusterDeploymentSummary()
- func (d *Deployer) SetConfig(config Config)
- func (d *Deployer) SetEnvrcFile(path string)
- func (d *Deployer) SetVerbose(verbose bool)
- func (d *Deployer) Teardown(ctx context.Context, components component.Component) error
- func (d *Deployer) TryTransferLocalImages(ctx context.Context, preLoader ImagePreLoader) error
- func (d *Deployer) WaitForCentral(timeout time.Duration) bool
- type HAProxyConfig
- type ImagePreLoader
- type OperatorConfig
- type OperatorDeploymentMode
- type ResourceToDelete
- type RoxieConfig
- type SecuredClusterConfig
- func (s *SecuredClusterConfig) ConfigureSpec(roxieConfig *RoxieConfig, centralConfig *CentralConfig) error
- func (s *SecuredClusterConfig) CustomResource() (map[string]interface{}, error)
- func (s *SecuredClusterConfig) EarlyReadinessEnabled() bool
- func (s *SecuredClusterConfig) EarlyReadinessSet() bool
- func (s *SecuredClusterConfig) GetWaitConfig() WaitConfig
- func (s *SecuredClusterConfig) PauseReconciliationEnabled() bool
- func (s *SecuredClusterConfig) PauseReconciliationSet() bool
- type WaitConfig
Constants ¶
This section is empty.
Variables ¶
var ( DefaultCentralWaitTimeout = 20 * time.Minute DefaultSecuredClusterWaitTimeout = 20 * time.Minute // AdminUsername is the default admin username for StackRox Central AdminUsername = "admin" )
var ( ErrLocalImagesUnsupported = errors.New("cluster does not support deploying with local images") ErrLocalImageRetrievalNotSupported = errors.New("image pre-loader does not support retrieval of images available on the cluster") )
Functions ¶
func KonfluxOperatorImage ¶ added in v0.4.3
KonfluxOperatorImage returns the Konflux-built operator image reference.
func OperatorBundleImage ¶ added in v0.4.2
func ParseFeatureFlags ¶
ParseFeatureFlags parses a slice of feature flag strings and returns a map of flag names to boolean values. Supports formats: +ROX_FOO (enable), -ROX_FOO (disable), ROX_FOO=true, ROX_FOO=false, ROX_FOO (enable)
func ParseOperatorEnvVar ¶ added in v0.4.2
ParseOperatorEnvVar parses a single KEY=VALUE environment variable string. Values may contain '=' characters (only the first '=' is used as the separator).
func PopulateKonfluxEnvVars ¶ added in v0.4.3
func PopulateKonfluxEnvVars(config *Config)
PopulateKonfluxEnvVars populates config.Operator.EnvVars with RELATED_IMAGE_* entries for Konflux image rewriting. Explicitly-provided env vars (e.g. from --operator-env) take precedence and are not overwritten.
Types ¶
type CentralConfig ¶
type CentralConfig struct {
Namespace string `yaml:"namespace,omitempty"`
ResourceProfile types.ResourceProfile `yaml:"resourceProfile,omitempty"`
PauseReconciliation *bool `yaml:"pauseReconciliation,omitempty"`
Exposure *types.Exposure `yaml:"exposure,omitempty"`
DeployTimeout time.Duration `yaml:"deployTimeout,omitempty"`
PortForwarding *bool `yaml:"portForwarding,omitempty"`
EarlyReadiness *bool `yaml:"earlyReadiness,omitempty"`
Spec map[string]interface{} `yaml:"spec,omitempty"`
}
CentralConfig holds deployment settings for the Central component.
func DefaultCentralConfig ¶
func DefaultCentralConfig() CentralConfig
DefaultCentralConfig returns a CentralConfig with sensible defaults.
func NewCentralConfig ¶ added in v0.4.2
func NewCentralConfig() CentralConfig
NewCentralConfig returns an emptry CentralConfig, with deep initialization of data structures.
func (*CentralConfig) ConfigureSpec ¶
func (c *CentralConfig) ConfigureSpec(roxieConfig *RoxieConfig) error
ConfigureSpec applies feature flags and exposure settings to the Central spec.
func (*CentralConfig) CustomResource ¶
func (c *CentralConfig) CustomResource() (map[string]interface{}, error)
CustomResource builds an unstructured Central custom resource from this config.
func (*CentralConfig) EarlyReadinessEnabled ¶ added in v0.4.1
func (c *CentralConfig) EarlyReadinessEnabled() bool
func (*CentralConfig) EarlyReadinessSet ¶ added in v0.4.2
func (c *CentralConfig) EarlyReadinessSet() bool
func (*CentralConfig) ExposureEnabled ¶
func (c *CentralConfig) ExposureEnabled() bool
func (*CentralConfig) ExposureSet ¶
func (c *CentralConfig) ExposureSet() bool
func (*CentralConfig) GetExposure ¶
func (c *CentralConfig) GetExposure() types.Exposure
func (*CentralConfig) GetWaitConfig ¶
func (c *CentralConfig) GetWaitConfig() WaitConfig
func (*CentralConfig) PauseReconciliationEnabled ¶ added in v0.4.2
func (c *CentralConfig) PauseReconciliationEnabled() bool
func (*CentralConfig) PauseReconciliationSet ¶ added in v0.4.2
func (c *CentralConfig) PauseReconciliationSet() bool
func (*CentralConfig) PortForwardingEnabled ¶
func (c *CentralConfig) PortForwardingEnabled() bool
func (*CentralConfig) PortForwardingSet ¶
func (c *CentralConfig) PortForwardingSet() bool
type Config ¶
type Config struct {
Roxie RoxieConfig `yaml:"roxie,omitempty"`
Operator OperatorConfig `yaml:"operator,omitempty"`
Central CentralConfig `yaml:"central,omitempty"`
SecuredCluster SecuredClusterConfig `yaml:"securedCluster,omitempty"`
}
Config is the top-level deployment configuration, combining settings for roxie itself, the operator, Central, and SecuredCluster.
func DefaultConfig ¶ added in v0.4.2
func DefaultConfig() Config
DefaultConfig returns a Config populated with default values.
type Deployer ¶
type Deployer struct {
// contains filtered or unexported fields
}
Deployer is the base deployer for ACS
func New ¶
New creates a new Deployer instance. It verifies that the current environment contains necessary tools. It creates a temporary directory for the deployer to use during deployment, and it is the caller's responsibility to clean it up using the Cleanup() method when not used anymore.
func (*Deployer) Cleanup ¶
func (d *Deployer) Cleanup()
Cleanup cleans up any temporary resources created by the deployer, such as temporary files.
func (*Deployer) GetCentralDeploymentInfo ¶
func (d *Deployer) GetCentralDeploymentInfo() types.CentralDeploymentInfo
func (*Deployer) GetContainerRuntimeSocket ¶ added in v0.4.2
func (*Deployer) GetKubeContext ¶ added in v0.4.2
func (*Deployer) GetPreLoaderForCluster ¶ added in v0.4.2
func (d *Deployer) GetPreLoaderForCluster() (ImagePreLoader, error)
GetPreLoaderForCluster returns an ImagePreLoader suited for the detected cluster type, or ErrLocalImagesUnsupported if the cluster does not support it.
func (*Deployer) PrintCentralDeploymentSummary ¶
func (d *Deployer) PrintCentralDeploymentSummary()
func (*Deployer) PrintSecuredClusterDeploymentSummary ¶
func (d *Deployer) PrintSecuredClusterDeploymentSummary()
TODO(#91): plenty of code in common with the central variant that should probably be extracted
func (*Deployer) SetEnvrcFile ¶
func (*Deployer) SetVerbose ¶
func (*Deployer) TryTransferLocalImages ¶ added in v0.4.2
func (d *Deployer) TryTransferLocalImages(ctx context.Context, preLoader ImagePreLoader) error
TryTransferLocalImages sends locally available ACS images to the cluster via the given pre-loader, skipping images already present in the cluster.
type HAProxyConfig ¶ added in v0.4.4
func (*HAProxyConfig) Enabled ¶ added in v0.4.4
func (c *HAProxyConfig) Enabled() bool
type ImagePreLoader ¶ added in v0.4.2
type ImagePreLoader interface {
SendImage(ctx context.Context, imageTag string) error
GetImages(ctx context.Context) ([]string, error)
Name() string
}
ImagePreLoader transfers container images into a local cluster's image store.
func NewCustomImagePreloader ¶ added in v0.4.2
type OperatorConfig ¶
type OperatorConfig struct {
SkipDeployment *bool `yaml:"skipDeployment,omitempty"`
DeployViaOlm *bool `yaml:"deployViaOlm,omitempty"`
Version string `yaml:"version,omitempty"`
EnvVars map[string]string `yaml:"envVars,omitempty"`
}
OperatorConfig controls how the ACS operator is deployed.
func (*OperatorConfig) Configure ¶
func (c *OperatorConfig) Configure(roxieConfig *RoxieConfig) error
Configure derives the operator version from the roxie configuration.
func (*OperatorConfig) DeployViaOlmEnabled ¶ added in v0.4.2
func (c *OperatorConfig) DeployViaOlmEnabled() bool
func (*OperatorConfig) DeployViaOlmSet ¶ added in v0.4.2
func (c *OperatorConfig) DeployViaOlmSet() bool
func (*OperatorConfig) SkipDeploymentEnabled ¶ added in v0.4.2
func (c *OperatorConfig) SkipDeploymentEnabled() bool
func (*OperatorConfig) SkipDeploymentSet ¶ added in v0.4.2
func (c *OperatorConfig) SkipDeploymentSet() bool
type OperatorDeploymentMode ¶
type OperatorDeploymentMode bool
OperatorDeploymentMode represents how the operator is deployed
const ( OperatorModeNonOLM OperatorDeploymentMode = false OperatorModeOLM OperatorDeploymentMode = true )
type ResourceToDelete ¶
type RoxieConfig ¶
type RoxieConfig struct {
Version string `yaml:"version,omitempty"`
KonfluxImages *bool `yaml:"konfluxImages,omitempty"`
FeatureFlags map[string]bool `yaml:"featureFlags,omitempty"`
ClusterType types.ClusterType `yaml:"clusterType,omitempty"`
HAProxy HAProxyConfig `yaml:"haProxy,omitempty"`
}
RoxieConfig holds roxie-level settings such as version and feature flags.
func DefaultRoxieConfig ¶ added in v0.4.4
func DefaultRoxieConfig() RoxieConfig
func NewRoxieConfig ¶
func NewRoxieConfig() RoxieConfig
NewRoxieConfig returns a RoxieConfig with initialized defaults.
func (*RoxieConfig) KonfluxImagesEnabled ¶ added in v0.4.2
func (c *RoxieConfig) KonfluxImagesEnabled() bool
func (*RoxieConfig) KonfluxImagesSet ¶ added in v0.4.2
func (c *RoxieConfig) KonfluxImagesSet() bool
type SecuredClusterConfig ¶
type SecuredClusterConfig struct {
Namespace string `yaml:"namespace,omitempty"`
ResourceProfile types.ResourceProfile `yaml:"resourceProfile,omitempty"`
PauseReconciliation *bool `yaml:"pauseReconciliation,omitempty"`
DeployTimeout time.Duration `yaml:"deployTimeout,omitempty"`
EarlyReadiness *bool `yaml:"earlyReadiness,omitempty"`
Spec map[string]interface{} `yaml:"spec,omitempty"`
}
SecuredClusterConfig holds deployment settings for the SecuredCluster component.
func DefaultSecuredClusterConfig ¶
func DefaultSecuredClusterConfig() SecuredClusterConfig
DefaultSecuredClusterConfig returns a SecuredClusterConfig with sensible defaults.
func NewSecuredClusterConfig ¶ added in v0.4.2
func NewSecuredClusterConfig() SecuredClusterConfig
NewSecuredClusterConfig returns an emptry SecuredClusterConfig, with deep initialization of data structures.
func (*SecuredClusterConfig) ConfigureSpec ¶
func (s *SecuredClusterConfig) ConfigureSpec(roxieConfig *RoxieConfig, centralConfig *CentralConfig) error
ConfigureSpec applies feature flags and the central endpoint to the SecuredCluster spec.
func (*SecuredClusterConfig) CustomResource ¶
func (s *SecuredClusterConfig) CustomResource() (map[string]interface{}, error)
CustomResource builds an unstructured SecuredCluster custom resource from this config.
func (*SecuredClusterConfig) EarlyReadinessEnabled ¶ added in v0.4.1
func (s *SecuredClusterConfig) EarlyReadinessEnabled() bool
func (*SecuredClusterConfig) EarlyReadinessSet ¶ added in v0.4.2
func (s *SecuredClusterConfig) EarlyReadinessSet() bool
func (*SecuredClusterConfig) GetWaitConfig ¶
func (s *SecuredClusterConfig) GetWaitConfig() WaitConfig
func (*SecuredClusterConfig) PauseReconciliationEnabled ¶ added in v0.4.2
func (s *SecuredClusterConfig) PauseReconciliationEnabled() bool
func (*SecuredClusterConfig) PauseReconciliationSet ¶ added in v0.4.2
func (s *SecuredClusterConfig) PauseReconciliationSet() bool