config

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

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

func ParseValueOverrides(overrides []string) (map[string]map[string]string, error)

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 NewConfig

func NewConfig(options ...Option) *Config

NewConfig returns a Config with default values.

func (*Config) AcceleratedNodeSelector

func (c *Config) AcceleratedNodeSelector() map[string]string

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) Attest added in v0.8.0

func (c *Config) Attest() bool

Attest returns whether bundle attestation is enabled.

func (*Config) CertificateIdentityRegexp added in v0.8.0

func (c *Config) CertificateIdentityRegexp() string

CertificateIdentityRegexp returns the custom identity pinning pattern for binary attestation verification, or empty string for the default.

func (*Config) Deployer

func (c *Config) Deployer() DeployerType

Deployer returns the deployment method (DeployerHelm or DeployerArgoCD).

func (*Config) EstimatedNodeCount added in v0.8.0

func (c *Config) EstimatedNodeCount() int

EstimatedNodeCount returns the estimated number of GPU nodes (0 means unset).

func (*Config) IncludeChecksums

func (c *Config) IncludeChecksums() bool

IncludeChecksums returns the include checksums setting.

func (*Config) IncludeReadme

func (c *Config) IncludeReadme() bool

IncludeReadme returns the include readme setting.

func (*Config) RepoURL

func (c *Config) RepoURL() string

RepoURL returns the Git repository URL for ArgoCD applications.

func (*Config) SystemNodeSelector

func (c *Config) SystemNodeSelector() map[string]string

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

func (c *Config) Validate() error

Validate checks if the Config has valid settings.

func (*Config) ValueOverrides

func (c *Config) ValueOverrides() map[string]map[string]string

ValueOverrides returns a deep copy of the value overrides to prevent modification.

func (*Config) Verbose

func (c *Config) Verbose() bool

Verbose returns the verbose setting.

func (*Config) Version

func (c *Config) Version() string

Version returns the bundler version.

func (*Config) WorkloadGateTaint

func (c *Config) WorkloadGateTaint() *corev1.Taint

WorkloadGateTaint returns a copy of the workload gate taint.

func (*Config) WorkloadSelector

func (c *Config) WorkloadSelector() map[string]string

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

func WithAcceleratedNodeSelector(selector map[string]string) Option

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 WithAttest added in v0.8.0

func WithAttest(attest bool) Option

WithAttest enables bundle attestation and binary verification.

func WithCertificateIdentityRegexp added in v0.8.0

func WithCertificateIdentityRegexp(pattern string) Option

WithCertificateIdentityRegexp overrides the default identity pinning pattern for binary attestation verification during bundle creation. The pattern must contain "github.com/NVIDIA/aicr/". This is intended for testing with binaries attested by non-release workflows (e.g., build-attested.yaml).

func WithDeployer

func WithDeployer(deployer DeployerType) Option

WithDeployer sets the deployment method.

func WithEstimatedNodeCount added in v0.8.0

func WithEstimatedNodeCount(n int) Option

WithEstimatedNodeCount sets the estimated number of GPU nodes. 0 means unset. Negative values are clamped to 0 for defense-in-depth.

func WithIncludeChecksums

func WithIncludeChecksums(enabled bool) Option

WithIncludeChecksums sets whether a checksums file should be included in the bundle.

func WithIncludeReadme

func WithIncludeReadme(enabled bool) Option

WithIncludeReadme sets whether a README should be included in the bundle.

func WithRepoURL

func WithRepoURL(repoURL string) Option

WithRepoURL sets the Git repository URL for ArgoCD applications.

func WithSystemNodeSelector

func WithSystemNodeSelector(selector map[string]string) Option

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

func WithValueOverrides(overrides map[string]map[string]string) Option

WithValueOverrides sets value overrides for the bundler.

func WithVerbose

func WithVerbose(enabled bool) Option

WithVerbose sets whether verbose logging is enabled for the bundler.

func WithVersion

func WithVersion(version string) Option

WithVersion sets the version for the bundler.

func WithWorkloadGateTaint

func WithWorkloadGateTaint(taint *corev1.Taint) Option

WithWorkloadGateTaint sets the taint for skyhook-operator runtime required feature.

func WithWorkloadSelector

func WithWorkloadSelector(selector map[string]string) Option

WithWorkloadSelector sets the label selector for skyhook-customizations to prevent eviction of running training jobs.

Jump to

Keyboard shortcuts

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