Documentation
¶
Overview ¶
Package config provides configuration options for bundler implementations.
This package defines the configuration structure and functional options pattern for customizing bundler behavior. All bundlers receive a Config instance that controls their output generation.
Configuration Options ¶
- Deployer: Deployment method (DeployerHelm or DeployerArgoCD)
- IncludeReadme: Generate deployment documentation
- IncludeChecksums: Generate SHA256 checksums.txt file
- Version: Bundler version string
- ValueOverrides: Per-bundler value overrides from CLI --set flags
- Verbose: Enable verbose output
Deployer Types ¶
DeployerType constants define supported deployment methods:
- DeployerHelm: Generates Helm per-component bundles (default)
- DeployerArgoCD: Generates ArgoCD App of Apps manifests
Use ParseDeployerType() to parse user input and GetDeployerTypes() for CLI help.
Usage ¶
cfg := config.NewConfig(
config.WithDeployer(config.DeployerHelm),
config.WithIncludeChecksums(true),
)
Defaults ¶
- Deployer: DeployerHelm
- IncludeReadme: true
- IncludeChecksums: true
- Version: "dev"
Config is immutable after creation, safe for concurrent use.
Index ¶
- func GetDeployerTypes() []string
- func ParseValueOverrides(overrides []string) (map[string]map[string]string, error)
- type Config
- func (c *Config) AcceleratedNodeSelector() map[string]string
- func (c *Config) AcceleratedNodeTolerations() []corev1.Toleration
- func (c *Config) Deployer() DeployerType
- func (c *Config) IncludeChecksums() bool
- func (c *Config) IncludeReadme() bool
- func (c *Config) RepoURL() string
- func (c *Config) SystemNodeSelector() map[string]string
- func (c *Config) SystemNodeTolerations() []corev1.Toleration
- func (c *Config) Validate() error
- func (c *Config) ValueOverrides() map[string]map[string]string
- func (c *Config) Verbose() bool
- func (c *Config) Version() string
- func (c *Config) WorkloadGateTaint() *corev1.Taint
- func (c *Config) WorkloadSelector() map[string]string
- type DeployerType
- type Option
- func WithAcceleratedNodeSelector(selector map[string]string) Option
- func WithAcceleratedNodeTolerations(tolerations []corev1.Toleration) Option
- func WithDeployer(deployer DeployerType) Option
- func WithIncludeChecksums(enabled bool) Option
- func WithIncludeReadme(enabled bool) Option
- func WithRepoURL(repoURL string) Option
- func WithSystemNodeSelector(selector map[string]string) Option
- func WithSystemNodeTolerations(tolerations []corev1.Toleration) Option
- func WithValueOverrides(overrides map[string]map[string]string) Option
- func WithVerbose(enabled bool) Option
- func WithVersion(version string) Option
- func WithWorkloadGateTaint(taint *corev1.Taint) Option
- func WithWorkloadSelector(selector map[string]string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDeployerTypes ¶
func GetDeployerTypes() []string
GetDeployerTypes returns a sorted slice of all supported deployer types. This is useful for CLI flag validation and usage messages.
func ParseValueOverrides ¶
ParseValueOverrides parses value override strings in format "bundler:path.to.field=value". Returns a map of bundler -> (path -> value). This function is used by both CLI and API handlers to parse --set flags and query parameters.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config provides immutable configuration options for bundlers. All fields are read-only after creation to prevent accidental modifications. Use Clone() to create a modified copy or Merge() to combine configurations.
func (*Config) AcceleratedNodeSelector ¶
AcceleratedNodeSelector returns a copy of the accelerated node selector map.
func (*Config) AcceleratedNodeTolerations ¶
func (c *Config) AcceleratedNodeTolerations() []corev1.Toleration
AcceleratedNodeTolerations returns a copy of the accelerated node tolerations.
func (*Config) Deployer ¶
func (c *Config) Deployer() DeployerType
Deployer returns the deployment method (DeployerHelm or DeployerArgoCD).
func (*Config) IncludeChecksums ¶
IncludeChecksums returns the include checksums setting.
func (*Config) IncludeReadme ¶
IncludeReadme returns the include readme setting.
func (*Config) SystemNodeSelector ¶
SystemNodeSelector returns a copy of the system node selector map.
func (*Config) SystemNodeTolerations ¶
func (c *Config) SystemNodeTolerations() []corev1.Toleration
SystemNodeTolerations returns a copy of the system node tolerations.
func (*Config) ValueOverrides ¶
ValueOverrides returns a deep copy of the value overrides to prevent modification.
func (*Config) WorkloadGateTaint ¶
WorkloadGateTaint returns a copy of the workload gate taint.
func (*Config) WorkloadSelector ¶
WorkloadSelector returns a copy of the workload selector map.
type DeployerType ¶
type DeployerType string
DeployerType represents the type of deployment method used for generated bundles.
const ( // DeployerHelm generates Helm per-component bundles (default). DeployerHelm DeployerType = "helm" // DeployerArgoCD generates ArgoCD App of Apps manifests. DeployerArgoCD DeployerType = "argocd" )
Supported deployer types.
func ParseDeployerType ¶
func ParseDeployerType(s string) (DeployerType, error)
ParseDeployerType parses a string into a DeployerType. Returns an error if the string is not a valid deployer type.
func (DeployerType) String ¶
func (d DeployerType) String() string
String returns the string representation of the DeployerType.
type Option ¶
type Option func(*Config)
func WithAcceleratedNodeSelector ¶
WithAcceleratedNodeSelector sets the node selector for accelerated/GPU nodes.
func WithAcceleratedNodeTolerations ¶
func WithAcceleratedNodeTolerations(tolerations []corev1.Toleration) Option
WithAcceleratedNodeTolerations sets the tolerations for accelerated/GPU nodes.
func WithDeployer ¶
func WithDeployer(deployer DeployerType) Option
WithDeployer sets the deployment method.
func WithIncludeChecksums ¶
WithIncludeChecksums sets whether a checksums file should be included in the bundle.
func WithIncludeReadme ¶
WithIncludeReadme sets whether a README should be included in the bundle.
func WithRepoURL ¶
WithRepoURL sets the Git repository URL for ArgoCD applications.
func WithSystemNodeSelector ¶
WithSystemNodeSelector sets the node selector for system components.
func WithSystemNodeTolerations ¶
func WithSystemNodeTolerations(tolerations []corev1.Toleration) Option
WithSystemNodeTolerations sets the tolerations for system components.
func WithValueOverrides ¶
WithValueOverrides sets value overrides for the bundler.
func WithVerbose ¶
WithVerbose sets whether verbose logging is enabled for the bundler.
func WithVersion ¶
WithVersion sets the version for the bundler.
func WithWorkloadGateTaint ¶
WithWorkloadGateTaint sets the taint for skyhook-operator runtime required feature.
func WithWorkloadSelector ¶
WithWorkloadSelector sets the label selector for skyhook-customizations to prevent eviction of running training jobs.