deployer

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCentralWaitTimeout        = 20 * time.Minute
	DefaultSecuredClusterWaitTimeout = 20 * time.Minute

	// AdminUsername is the default admin username for StackRox Central
	AdminUsername = "admin"
)

Functions

func ParseFeatureFlags

func ParseFeatureFlags(flags []string) (map[string]bool, error)

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)

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 (*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) 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) 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 NewConfig

func NewConfig() Config

NewConfig returns a Config populated with default values.

func (*Config) DeepCopy

func (c *Config) DeepCopy() (*Config, error)

DeepCopy creates a deep-copy of the provided config using a YAML marshaling/unmarshaling roundtrip. Due the `omitempty`, this causes empty values (e.g. empty maps) from being discarded (replace with nil in the resulting copy).

type Deployer

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

Deployer is the base deployer for ACS

func New

func New(log *logger.Logger) (*Deployer, error)

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) Deploy

func (d *Deployer) Deploy(ctx context.Context, components component.Component) error

Deploy deploys the specified components to the cluster.

func (*Deployer) GetCentralDeploymentInfo

func (d *Deployer) GetCentralDeploymentInfo() types.CentralDeploymentInfo

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) SetConfig

func (d *Deployer) SetConfig(config Config)

func (*Deployer) SetEnvrcFile

func (d *Deployer) SetEnvrcFile(path string)

func (*Deployer) SetVerbose

func (d *Deployer) SetVerbose(verbose bool)

func (*Deployer) Teardown

func (d *Deployer) Teardown(ctx context.Context, components component.Component) error

func (*Deployer) WaitForCentral

func (d *Deployer) WaitForCentral(timeout time.Duration) bool

WaitForCentral waits for Central to be ready and responding on its endpoint Returns true if Central is ready, false if timeout occurs

type OperatorConfig

type OperatorConfig struct {
	SkipDeployment bool   `yaml:"skipDeployment,omitempty"`
	DeployViaOlm   bool   `yaml:"deployViaOlm,omitempty"`
	Version        string `yaml:"version,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.

type OperatorDeploymentMode

type OperatorDeploymentMode bool

OperatorDeploymentMode represents how the operator is deployed

const (
	OperatorModeNonOLM OperatorDeploymentMode = false
	OperatorModeOLM    OperatorDeploymentMode = true
)

type ResourceToDelete

type ResourceToDelete struct {
	Kind      string
	Name      string
	OwnerName string
}

type RoxctlOptions

type RoxctlOptions struct {
	Args              []string          // Command arguments (e.g., ["central", "crs", "generate", "cluster-name"])
	Env               map[string]string // Additional environment variables
	UseAuthentication bool              // Whether to set ROX_ADMIN_PASSWORD and ROX_CA_CERT_FILE
	MaxAttempts       int               // Maximum number of retry attempts (default: 5)
	RetryDelay        int               // Base retry delay in seconds (default: 10, multiplied by attempt number)
}

RoxctlOptions contains options for running roxctl commands

type RoxctlResult

type RoxctlResult struct {
	Stdout string
	Stderr string
}

RoxctlResult contains the result of a roxctl command execution

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"`
}

RoxieConfig holds roxie-level settings such as version and feature flags.

func NewRoxieConfig

func NewRoxieConfig() RoxieConfig

NewRoxieConfig returns a RoxieConfig with initialized defaults.

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 (*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) GetWaitConfig

func (s *SecuredClusterConfig) GetWaitConfig() WaitConfig

type WaitConfig

type WaitConfig struct {
	Namespace      string
	EarlyReadiness bool
	WaitFor        string
	Timeout        time.Duration
}

WaitConfig describes how to wait for a component to become ready.

Jump to

Keyboard shortcuts

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