config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(cfg OperatorConfig) error

Validate validates the complete operator configuration

Types

type ClusterConfig

type ClusterConfig struct {
	Name           string
	ArgoCDMode     string // internal|external
	ArgoCDEndpoint string
	ArgoCDToken    string
}

ClusterConfig contains per-cluster ArgoCD configuration (value type)

type GitHubConfig

type GitHubConfig struct {
	Token string
	Org   string
}

GitHubConfig contains GitHub API configuration (value type)

type Loader

type Loader interface {
	Load(ctx context.Context) (OperatorConfig, error)
}

Loader defines the interface for loading operator configuration

func NewCRDLoader

func NewCRDLoader(k8sClient client.Client) Loader

NewCRDLoader creates a new CRD-based configuration loader

func NewEnvLoader

func NewEnvLoader() Loader

NewEnvLoader creates a new environment variable-based configuration loader

type ObservabilityConfig

type ObservabilityConfig struct {
	MetricsEnabled bool
	MetricsPort    int
	TracingEnabled bool
	LogLevel       string
}

ObservabilityConfig contains observability settings (value type)

type OperatorBehavior

type OperatorBehavior struct {
	ReconcileInterval time.Duration
	WorkerPoolSize    int
}

OperatorBehavior contains operator runtime behavior settings (value type)

type OperatorConfig

type OperatorConfig struct {
	GitHub        GitHubConfig
	Clusters      []ClusterConfig
	Operator      OperatorBehavior
	Observability ObservabilityConfig
	Webhook       WebhookConfig
}

OperatorConfig represents the complete operator configuration (value type)

type WebhookConfig

type WebhookConfig struct {
	// Enabled controls whether the webhook server is enabled
	Enabled bool

	// Addr is the address to listen on (e.g., ":8080", "0.0.0.0:8080")
	Addr string

	// Secret is the GitHub webhook secret for HMAC validation
	Secret string

	// TLSCertFile is the path to the TLS certificate file (optional)
	TLSCertFile string

	// TLSKeyFile is the path to the TLS key file (optional)
	TLSKeyFile string

	// DiscoveryMode determines how PRs are discovered: webhook|polling|hybrid
	// - webhook: only process webhook events (fastest, but requires reliable delivery)
	// - polling: only use periodic polling (slower, but more reliable)
	// - hybrid: webhook primary with polling as safety net (recommended)
	DiscoveryMode string
}

WebhookConfig contains webhook server configuration (value type)

Jump to

Keyboard shortcuts

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