v2

package
v0.0.0-...-2170ac4 Latest Latest
Warning

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

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

README

V2 Configuration Package

This package implements the v2 cluster configuration schema for opencenter-cli.

Overview

The v2 schema redesigns opencenter-cli's configuration system to eliminate duplication, establish clear ownership hierarchies, isolate provider-specific settings, and support advanced deployment methods like Kamaji hosted control planes.

Key Design Principles

  1. Single Source of Truth: Each setting defined exactly once at the appropriate hierarchy level
  2. Provider Isolation: Provider-specific settings isolated under infrastructure.cloud.<provider>
  3. Deployment Abstraction: Deployment method (how) separated from infrastructure provider (where)
  4. Reference Resolution: Explicit ${path.to.value} syntax for shared resources
  5. Context-Aware Defaults: Provider-region registry supplies intelligent defaults
  6. Strict Validation: only schema_version: "2.0" is accepted

Package Structure

Core Configuration (config.go)
  • Config: Root v2 configuration structure
  • OpenCenterConfig: Main opencenter configuration with five domains
  • MetaConfig: Cluster identity and organizational context
  • SecretsConfig: Secrets configuration
  • GitOpsConfig: GitOps repository configuration
  • OpenTofuConfig: OpenTofu backend configuration
Infrastructure Domain (infrastructure.go)
  • InfrastructureConfig: Provider-agnostic infrastructure with provider-specific extensions
  • NetworkingConfig: Infrastructure networking (subnet_nodes, VRRP IP, DNS, NTP)
  • ComputeConfig: Compute resources (flavors, node counts, worker pools)
  • StorageConfig: Storage configuration (boot volumes, additional devices)
  • CloudConfig: Polymorphic provider-specific configuration
  • Provider-specific configs: OpenStackCloudConfig, AWSCloudConfig, GCPCloudConfig, AzureCloudConfig, VMwareCloudConfig
Cluster Domain (cluster.go)
  • ClusterConfig: Kubernetes-specific configuration independent of infrastructure
  • KubernetesConfig: Kubernetes cluster configuration
  • NetworkPluginConfig: CNI plugin configuration (Calico, Cilium, Kube-OVN)
  • StoragePluginConfig: CSI plugin configuration (vSphere CSI, Cinder CSI, AWS EBS CSI, etc.)
  • KubernetesSecurityConfig: Kubernetes security configuration
  • OIDCConfig: OIDC authentication configuration
Deployment Domain (deployment.go)
  • DeploymentConfig: Deployment method configuration
  • KubesprayConfig: Kubespray deployment configuration
  • TalosConfig: Talos Linux deployment configuration
  • KamajiConfig: Kamaji hosted control plane configuration
  • KamajiControlPlane: Kamaji control plane configuration
  • ClusterAPIConfig: Cluster API configuration
  • KamajiWorkerPool: Kamaji worker pool configuration with mixed OS support
Services (services.go)
  • ServiceMap: Polymorphic map of service configurations
  • BaseServiceConfig: Common fields shared by all services
  • Custom YAML marshaling/unmarshaling using service registry
Provider Validation (provider.go)
  • Provider interface: Provider-specific validation
  • OpenStackProvider: OpenStack-specific validation
  • AWSProvider: AWS-specific validation
  • GCPProvider: GCP-specific validation
  • AzureProvider: Azure-specific validation
Deployment Validation (deployment_validator.go)
  • DeploymentMethod interface: Deployment-method-specific validation
  • KubesprayDeployment: Kubespray deployment validation
  • TalosDeployment: Talos deployment validation
  • KamajiDeployment: Kamaji deployment validation
  • ValidateKamajiControlPlane: Kamaji control plane validation
  • ValidateKamajiWorkerPool: Kamaji worker pool validation
  • ValidateClusterAPIProviders: Cluster API provider validation

Property-Based Tests

The package includes comprehensive property-based tests using gopter:

Property 1: Configuration Structure Invariants (config_property_test.go)

Validates that structural invariants hold for all valid v2 configurations:

  • VRRP IP only in infrastructure.networking.vrrp_ip
  • Provider-specific settings only in matching cloud section
  • Infrastructure networking fields only in infrastructure.networking
  • Compute configuration only in infrastructure.compute
  • Storage configuration only in infrastructure.storage

Validates: Requirements 1.1, 1.2, 2.1, 3.1, 4.1

Property 8: Kamaji Deployment Constraints (deployment_property_test.go)

Validates Kamaji deployment constraints:

  • master_count must be zero
  • vrrp_enabled must be false
  • kube_vip_enabled must be false
  • Control plane replicas must be odd (1, 3, 5, 7)
  • At least one worker pool must be defined
  • Bootstrap provider must match OS (ubuntu/windows→kubeadm, talos→talos)
  • Talos worker pools require talos_version
  • Autoscaling constraints are valid

Validates: Requirements 10.2, 10.3, 10.8, 10.10, 10.11, 10.12

Property 12: Provider-Deployment Compatibility (deployment_property_test.go)

Validates provider-deployment compatibility:

  • Valid combinations are accepted (OpenStack+Kubespray, AWS+EKS, etc.)
  • Invalid combinations are rejected
  • Kubespray supports all providers
  • Talos does not support baremetal
  • Kamaji does not support baremetal
  • Deployment methods requiring masters reject master_count=0

Validates: Requirements 5.7

Property 13: Multiple Provider Section Rejection (provider_property_test.go)

Validates that only one provider section can be populated:

  • Single provider section is valid
  • Multiple provider sections are rejected
  • Provider mismatch is rejected

Validates: Requirements 4.7

Running Tests

# Run all v2 tests
go test ./internal/config/v2/... -v

# Run specific property test
go test ./internal/config/v2/... -v -run TestProperty_ConfigurationStructureInvariants

# Run all property tests
go test ./internal/config/v2/... -v -run Property

Usage Example

package main

import (
    "github.com/opencenter-cloud/opencenter-cli/internal/config/v2"
)

func main() {
    cfg := &v2.Config{
        SchemaVersion: "2.0",
        OpenCenter: v2.OpenCenterConfig{
            Meta: v2.MetaConfig{
                Name:         "my-cluster",
                Organization: "my-org",
                Env:          "production",
                Region:       "sjc3",
            },
            Cluster: v2.ClusterConfig{
                ClusterName: "my-cluster",
                BaseDomain:  "example.com",
                ClusterFQDN: "my-cluster.example.com",
                AdminEmail:  "admin@example.com",
                Kubernetes: v2.KubernetesConfig{
                    Version:        "1.28.0",
                    APIPort:        6443,
                    SubnetPods:     "10.233.64.0/18",
                    SubnetServices: "10.233.0.0/18",
                },
            },
            Infrastructure: v2.InfrastructureConfig{
                Provider: "openstack",
                // ... infrastructure configuration
            },
        },
    }

    // Validate provider configuration
    provider, err := v2.GetProvider(cfg.OpenCenter.Infrastructure.Provider)
    if err != nil {
        panic(err)
    }
    
    if err := provider.ValidateConfig(&cfg.OpenCenter.Infrastructure); err != nil {
        panic(err)
    }
}

Next Steps

Phase 4 (Intelligence) will implement:

  • Reference resolution system
  • Service provider polymorphism
  • Service dependency validation
  • Required secrets validation

Future work will focus on:

  • Reference resolution improvements
  • Service provider polymorphism
  • Required secrets validation

Documentation

Index

Constants

View Source
const (
	OIDCSourceInternal = "internal"
	OIDCSourceExternal = "external"

	OIDCProviderKeycloak = "keycloak"
	OIDCProviderEntra    = "entra"
	OIDCProviderGeneric  = "generic"
)
View Source
const (
	StageInit      = "init"
	StagePreflight = "preflight"
	StageSetup     = "setup"
	StageBootstrap = "bootstrap"
	StageValidate  = "validate"
	StageDestroy   = "destroy"
	StageRender    = "render"
	StagePlan      = "plan"
	StageApply     = "apply"
)

Cluster lifecycle stages.

View Source
const (
	StatusPending = "pending"
	StatusRunning = "running"
	StatusSuccess = "success"
	StatusFailed  = "failed"
)

Cluster lifecycle statuses.

View Source
const (
	ValidationModeOffline = "offline"
	ValidationModeOnline  = "online"
)

Validation modes.

View Source
const (
	GitopsAuthMethodSSH   = "ssh"
	GitopsAuthMethodToken = "token"
)

GitOps authentication methods.

View Source
const DefaultSSHAuthorizedKeyPlaceholder = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExamplePublicKeyDataHere user@example.com"

DefaultSSHAuthorizedKeyPlaceholder is the placeholder SSH key used in templates.

View Source
const PlaceholderSecret = "CHANGEME"

PlaceholderSecret is the sentinel value used in default configurations to indicate that a secret must be replaced before deployment.

Variables

This section is empty.

Functions

func GetErrorField

func GetErrorField(err error) string

GetErrorField extracts the field name from a validation error.

Parameters:

  • err: The error to extract from

Returns:

  • string: The field name, or empty string if not a validation error

func GetErrorFilePath

func GetErrorFilePath(err error) string

GetErrorFilePath extracts the file path from a file or parse error.

Parameters:

  • err: The error to extract from

Returns:

  • string: The file path, or empty string if not available

func GetErrorSuggestions

func GetErrorSuggestions(err error) []string

GetErrorSuggestions extracts suggestions from a structured error.

Parameters:

  • err: The error to extract from

Returns:

  • []string: The suggestions, or empty slice if not available

func IsConfigNotFoundError

func IsConfigNotFoundError(err error) bool

IsConfigNotFoundError checks whether err (or any error in its chain) is a ConfigNotFoundError.

func IsFileNotFoundError

func IsFileNotFoundError(err error) bool

IsFileNotFoundError checks if an error is a "file not found" error.

This is useful for distinguishing between different types of file errors and providing appropriate error handling.

Parameters:

  • err: The error to check

Returns:

  • bool: true if the error indicates a file was not found

Example:

config, err := manager.Load(ctx, "my-cluster")
if IsFileNotFoundError(err) {
    // Handle missing configuration
    return initializeNewConfig()
}

func IsParseError

func IsParseError(err error) bool

IsParseError checks if an error is a YAML parsing error.

Parameters:

  • err: The error to check

Returns:

  • bool: true if the error is a parse error

func IsPathError

func IsPathError(err error) bool

IsPathError checks if an error is a path resolution error.

Parameters:

  • err: The error to check

Returns:

  • bool: true if the error is a path error

func IsValidationError

func IsValidationError(err error) bool

IsValidationError checks if an error is a validation error.

Parameters:

  • err: The error to check

Returns:

  • bool: true if the error is a validation error

func NewConfigError

func NewConfigError(operation, message string, cause error) *errors.StructuredError

NewConfigError creates a general configuration error.

This error type is used for general configuration-related errors that don't fit into the more specific categories (file, validation, path, parse).

Parameters:

  • operation: The operation that failed (e.g., "load", "save", "delete")
  • message: A description of what went wrong
  • cause: The underlying error (can be nil)

Returns:

  • *errors.StructuredError: A structured error with configuration context

Example:

err := NewConfigError("load", "configuration is corrupted", nil)
// Error: configuration operation failed: load
// Message: configuration is corrupted

func NewFileError

func NewFileError(operation, path string, cause error) *errors.StructuredError

NewFileError creates a file operation error with configuration context.

This error type is used when file operations fail during configuration loading, saving, or deletion. It includes the file path and operation context to help users diagnose and fix the issue.

Parameters:

  • operation: The file operation that failed (e.g., "read", "write", "delete")
  • path: The file path that was being accessed
  • cause: The underlying error that caused the failure

Returns:

  • *errors.StructuredError: A structured error with file context

Example:

err := NewFileError("read", "/path/to/config.yaml", os.ErrNotExist)
// Error: file operation failed: read
// Path: /path/to/config.yaml
// Suggestions:
//   - Verify the path exists: ls -la /path/to/config.yaml
//   - Check file permissions and ownership

func NewParseError

func NewParseError(filePath string, lineNumber, columnNumber int, cause error) *errors.StructuredError

NewParseError creates a YAML parsing error with file context.

This error type is used when YAML parsing fails during configuration loading. It includes file path and line/column information when available to help users locate and fix syntax errors.

Parameters:

  • filePath: The path to the file being parsed
  • lineNumber: The line number where parsing failed (0 if unknown)
  • columnNumber: The column number where parsing failed (0 if unknown)
  • cause: The underlying parsing error

Returns:

  • *errors.StructuredError: A structured error with parse context

Example:

err := NewParseError("/path/to/config.yaml", 42, 15, yamlErr)
// Error: failed to parse YAML configuration
// File: /path/to/config.yaml:42:15
// Suggestions:
//   - Validate YAML syntax with: yamllint /path/to/config.yaml
//   - Check for proper indentation (use spaces, not tabs)

func NewPathError

func NewPathError(clusterName, organization string, cause error) *errors.StructuredError

NewPathError creates a path resolution error with cluster context.

This error type is used when path resolution fails for a cluster configuration. It includes the cluster name and organization to help users understand which configuration could not be found.

Parameters:

  • clusterName: The name of the cluster being accessed
  • organization: The organization name (can be empty)
  • cause: The underlying error that caused the path resolution failure

Returns:

  • *errors.StructuredError: A structured error with path context

Example:

err := NewPathError("my-cluster", "my-org", os.ErrNotExist)
// Error: failed to resolve path for cluster "my-cluster"
// Suggestions:
//   - Verify cluster exists: opencenter cluster list
//   - Check organization name is correct

func NewValidationError

func NewValidationError(field, message string, cause error) *errors.StructuredError

NewValidationError creates a validation error with field context.

This error type is used when configuration validation fails. It includes the field name and specific validation failure details to help users correct their configuration.

Parameters:

  • field: The configuration field that failed validation
  • message: A description of the validation failure
  • cause: The underlying error (can be nil)

Returns:

  • *errors.StructuredError: A structured error with validation context

Example:

err := NewValidationError("cluster.name", "cluster name cannot be empty", nil)
// Error: Field 'cluster.name': cluster name cannot be empty
// Suggestions:
//   - Run: opencenter cluster validate to check configuration
//   - Edit configuration: opencenter cluster edit

func RenderFullTemplateYAML

func RenderFullTemplateYAML(name, provider string) ([]byte, error)

RenderFullTemplateYAML renders a commented, schema-valid full template.

func RenderFullTemplateYAMLFromConfig

func RenderFullTemplateYAMLFromConfig(cfg *Config) ([]byte, error)

RenderFullTemplateYAMLFromConfig renders a commented, schema-valid full template from an already-populated v2 config.

func ValidateClusterAPIProviders

func ValidateClusterAPIProviders(providers *ClusterAPIProviders, infraProvider string) error

ValidateClusterAPIProviders validates Cluster API provider configuration. Requirements: 10.9

func ValidateForDeployment

func ValidateForDeployment(cfg *Config) error

ValidateForDeployment performs all standard validation plus deployment-readiness checks such as detecting placeholder secrets that must be replaced.

func ValidateKamajiControlPlane

func ValidateKamajiControlPlane(cp *KamajiControlPlane) error

ValidateKamajiControlPlane validates Kamaji control plane configuration. Requirements: 10.10, 10.11, 10.12

func ValidateKamajiWorkerPool

func ValidateKamajiWorkerPool(pool *KamajiWorkerPool) error

ValidateKamajiWorkerPool validates Kamaji worker pool configuration. Requirements: 10.11, 10.12

func WrapFileError

func WrapFileError(err error, operation, path string) error

WrapFileError wraps an existing error as a file error with additional context.

This is useful when you want to add file operation context to an error that was returned from a lower-level function.

Parameters:

  • err: The error to wrap
  • operation: The file operation being performed
  • path: The file path being accessed

Returns:

  • error: The wrapped error with file context

Example:

data, err := os.ReadFile(path)
if err != nil {
    return nil, WrapFileError(err, "read", path)
}

func WrapParseError

func WrapParseError(err error, filePath string, lineNumber, columnNumber int) error

WrapParseError wraps an existing error as a parse error.

Parameters:

  • err: The error to wrap
  • filePath: The file being parsed
  • lineNumber: The line number where parsing failed
  • columnNumber: The column number where parsing failed

Returns:

  • error: The wrapped error with parse context

func WrapPathError

func WrapPathError(err error, clusterName, organization string) error

WrapPathError wraps an existing error as a path error.

Parameters:

  • err: The error to wrap
  • clusterName: The cluster name
  • organization: The organization name

Returns:

  • error: The wrapped error with path context

func WrapValidationError

func WrapValidationError(err error, field string) error

WrapValidationError wraps an existing error as a validation error.

Parameters:

  • err: The error to wrap
  • field: The field that failed validation

Returns:

  • error: The wrapped error with validation context

Types

type AWSCloudConfig

type AWSCloudConfig struct {
	Region            string   `yaml:"region" json:"region" validate:"required"`
	VPCID             string   `yaml:"vpc_id" json:"vpc_id" validate:"required"`
	SubnetIDs         []string `yaml:"subnet_ids" json:"subnet_ids" validate:"required,min=1"`
	AMIID             string   `yaml:"ami_id" json:"ami_id" validate:"required"`
	AvailabilityZones []string `yaml:"availability_zones,omitempty" json:"availability_zones,omitempty"`
	KeyPairName       string   `yaml:"key_pair_name,omitempty" json:"key_pair_name,omitempty"`
	SecurityGroupIDs  []string `yaml:"security_group_ids,omitempty" json:"security_group_ids,omitempty"`
}

AWSCloudConfig represents AWS-specific configuration. Requirements: 4.4

type AWSGlobalSecrets

type AWSGlobalSecrets struct {
	Infrastructure AWSScopedSecrets `yaml:"infrastructure,omitempty" json:"infrastructure,omitempty"`
	Application    AWSScopedSecrets `yaml:"application,omitempty" json:"application,omitempty"`
}

type AWSProvider

type AWSProvider struct{}

AWSProvider implements provider validation for AWS. Requirements: 4.4

func (*AWSProvider) GetProviderName

func (p *AWSProvider) GetProviderName() string

GetProviderName returns the provider name.

func (*AWSProvider) ValidateConfig

func (p *AWSProvider) ValidateConfig(cfg *InfrastructureConfig) error

ValidateConfig validates AWS-specific configuration.

type AWSScopedSecrets

type AWSScopedSecrets struct {
	AccessKey       string `yaml:"access_key,omitempty" json:"access_key,omitempty"`
	SecretAccessKey string `yaml:"secret_access_key,omitempty" json:"secret_access_key,omitempty"`
	Region          string `yaml:"region,omitempty" json:"region,omitempty"`
}

type AlertProxySecrets

type AlertProxySecrets struct {
	CoreDeviceId        string `yaml:"core_device_id,omitempty" json:"core_device_id,omitempty"`
	AccountServiceToken string `yaml:"account_service_token,omitempty" json:"account_service_token,omitempty"`
	CoreAccountNumber   string `yaml:"core_account_number,omitempty" json:"core_account_number,omitempty"`
}

type AutoscalingConfig

type AutoscalingConfig struct {
	Enabled     bool `yaml:"enabled" json:"enabled"`
	MinReplicas int  `yaml:"min_replicas,omitempty" json:"min_replicas,omitempty" validate:"omitempty,min=1"`
	MaxReplicas int  `yaml:"max_replicas,omitempty" json:"max_replicas,omitempty" validate:"omitempty,gtefield=MinReplicas"`
}

AutoscalingConfig represents autoscaling configuration for worker pools.

type AwsEbsCsiConfig

type AwsEbsCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

AwsEbsCsiConfig represents AWS EBS CSI driver configuration.

type AzureCloudConfig

type AzureCloudConfig struct {
	SubscriptionID    string   `yaml:"subscription_id" json:"subscription_id" validate:"required"`
	ResourceGroup     string   `yaml:"resource_group" json:"resource_group" validate:"required"`
	Location          string   `yaml:"location" json:"location" validate:"required"`
	VNetName          string   `yaml:"vnet_name" json:"vnet_name" validate:"required"`
	SubnetName        string   `yaml:"subnet_name" json:"subnet_name" validate:"required"`
	ImageReference    string   `yaml:"image_reference" json:"image_reference" validate:"required"`
	AvailabilityZones []string `yaml:"availability_zones,omitempty" json:"availability_zones,omitempty"`
}

AzureCloudConfig represents Azure-specific configuration. Requirements: 4.6

type AzureDiskCsiConfig

type AzureDiskCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

AzureDiskCsiConfig represents Azure Disk CSI driver configuration.

type AzureProvider

type AzureProvider struct{}

AzureProvider implements provider validation for Azure. Requirements: 4.6

func (*AzureProvider) GetProviderName

func (p *AzureProvider) GetProviderName() string

GetProviderName returns the provider name.

func (*AzureProvider) ValidateConfig

func (p *AzureProvider) ValidateConfig(cfg *InfrastructureConfig) error

ValidateConfig validates Azure-specific configuration.

type BackendConfig

type BackendConfig struct {
	Type   string              `yaml:"type" json:"type" validate:"required,oneof=s3 local remote"`
	Local  *LocalBackendConfig `yaml:"local,omitempty" json:"local,omitempty"`
	S3     *S3BackendConfig    `yaml:"s3,omitempty" json:"s3,omitempty"`
	Config map[string]any      `yaml:"config,omitempty" json:"config,omitempty"`
}

BackendConfig represents OpenTofu backend configuration. Requirements: 20.1, 20.2, 20.3, 20.4

type BarbicanConfig

type BarbicanConfig struct {
	AuthURL           string `yaml:"auth_url,omitempty" json:"auth_url,omitempty"`
	ProjectID         string `yaml:"project_id,omitempty" json:"project_id,omitempty"`
	Region            string `yaml:"region,omitempty" json:"region,omitempty"`
	UserDomainName    string `yaml:"user_domain_name,omitempty" json:"user_domain_name,omitempty"`
	ProjectDomainName string `yaml:"project_domain_name,omitempty" json:"project_domain_name,omitempty"`
	CACert            string `yaml:"ca_cert,omitempty" json:"ca_cert,omitempty"`
}

type BastionConfig

type BastionConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Address string `yaml:"address,omitempty" json:"address,omitempty"`
	Flavor  string `yaml:"flavor,omitempty" json:"flavor,omitempty" validate:"required_if=Enabled true"`
	Image   string `yaml:"image,omitempty" json:"image,omitempty" validate:"required_if=Enabled true"`
}

BastionConfig represents bastion host configuration.

type BlockDeviceConfig

type BlockDeviceConfig struct {
	Name                string `yaml:"name" json:"name" validate:"required"`
	Size                int    `yaml:"size" json:"size" validate:"required,min=1"`
	Type                string `yaml:"type,omitempty" json:"type,omitempty"`
	MountPath           string `yaml:"mount_path,omitempty" json:"mount_path,omitempty"`
	DeleteOnTermination bool   `yaml:"delete_on_termination" json:"delete_on_termination"`
}

BlockDeviceConfig represents additional block device configuration.

type CAPIAWSConfig

type CAPIAWSConfig struct {
	Region string `yaml:"region,omitempty" json:"region,omitempty"`
}

CAPIAWSConfig represents CAPI AWS provider configuration.

type CAPIAzureConfig

type CAPIAzureConfig struct {
	Location string `yaml:"location,omitempty" json:"location,omitempty"`
}

CAPIAzureConfig represents CAPI Azure provider configuration.

type CAPIOpenStackConfig

type CAPIOpenStackConfig struct {
	CloudsYAML string `yaml:"clouds_yaml,omitempty" json:"clouds_yaml,omitempty"`
	CloudName  string `yaml:"cloud_name,omitempty" json:"cloud_name,omitempty"`
}

CAPIOpenStackConfig represents CAPI OpenStack provider configuration.

type CAPIVMwareConfig

type CAPIVMwareConfig struct {
	Server string `yaml:"server,omitempty" json:"server,omitempty"`
}

CAPIVMwareConfig represents CAPI VMware provider configuration.

type CNIModuleSource

type CNIModuleSource struct {
	Source string `yaml:"source,omitempty" json:"source,omitempty"`
}

CNIModuleSource holds the source URL for a CNI module.

type CNIModulesConfig

type CNIModulesConfig struct {
	Calico  CNIModuleSource `yaml:"calico,omitempty" json:"calico,omitempty"`
	Cilium  CNIModuleSource `yaml:"cilium,omitempty" json:"cilium,omitempty"`
	KubeOVN CNIModuleSource `yaml:"kube_ovn,omitempty" json:"kube_ovn,omitempty"`
}

CNIModulesConfig holds module source references for CNI plugins.

type CalicoConfig

type CalicoConfig struct {
	Enabled                   bool             `yaml:"enabled" json:"enabled"`
	Version                   string           `yaml:"version,omitempty" json:"version,omitempty"`
	IPIPMode                  string           `yaml:"ipip_mode,omitempty" json:"ipip_mode,omitempty" validate:"omitempty,oneof=Always CrossSubnet Never"`
	VXLANMode                 string           `yaml:"vxlan_mode,omitempty" json:"vxlan_mode,omitempty" validate:"omitempty,oneof=Always CrossSubnet Never"`
	NetworkPolicy             bool             `yaml:"network_policy" json:"network_policy"`
	CNIIface                  string           `yaml:"cni_iface,omitempty" json:"cni_iface,omitempty"`
	CalicoInterfaceAutodetect string           `yaml:"calico_interface_autodetect,omitempty" json:"calico_interface_autodetect,omitempty"`
	AutodetectCIDR            string           `yaml:"autodetect_cidr,omitempty" json:"autodetect_cidr,omitempty"`
	EncapsulationType         string           `yaml:"encapsulation_type,omitempty" json:"encapsulation_type,omitempty"`
	NATOutgoing               bool             `yaml:"nat_outgoing" json:"nat_outgoing"`
	Modules                   CNIModulesConfig `yaml:"modules,omitempty" json:"modules,omitempty"`
	// InstallMethod specifies how the CNI should be installed.
	// Valid values: "helm" (default), "kustomize-helm", or "kubespray" for non-OpenStack migration compatibility.
	InstallMethod string `yaml:"install_method,omitempty" json:"install_method,omitempty" validate:"omitempty,oneof=kubespray helm kustomize-helm"`
}

CalicoConfig represents Calico CNI configuration.

type CephCsiConfig

type CephCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

CephCsiConfig represents Ceph CSI driver configuration.

type CertManagerAWSCredential

type CertManagerAWSCredential struct {
	Enabled            bool     `yaml:"enabled" json:"enabled" jsonschema:"description=Enable this AWS credential for cert-manager"`
	AWSAccessKey       string   `yaml:"aws_access_key" json:"aws_access_key" jsonschema:"secret=true,description=AWS access key for Route53 DNS validation"`
	AWSSecretAccessKey string   `` /* 143-byte string literal not displayed */
	Region             string   `yaml:"region,omitempty" json:"region,omitempty" jsonschema:"description=AWS region for Route53"`
	DNSZones           []string `yaml:"dns_zones,omitempty" json:"dns_zones,omitempty" jsonschema:"description=DNS zones this credential validates"`
}

CertManagerAWSCredential holds a named AWS Route53 credential for cert-manager.

type CertManagerCloudflareCredential

type CertManagerCloudflareCredential struct {
	Enabled  bool     `yaml:"enabled" json:"enabled" jsonschema:"description=Enable this Cloudflare credential for cert-manager"`
	APIToken string   `yaml:"api_token" json:"api_token" jsonschema:"secret=true,description=Cloudflare API token for DNS validation"`
	DNSZones []string `yaml:"dns_zones,omitempty" json:"dns_zones,omitempty" jsonschema:"description=DNS zones this credential validates"`
}

CertManagerCloudflareCredential holds a named Cloudflare credential for cert-manager.

type CertManagerSecrets

type CertManagerSecrets struct {
	// Dynamic multi-credential support: map of named credentials per provider.
	AWS        map[string]CertManagerAWSCredential        `yaml:"aws,omitempty" json:"aws,omitempty"`
	Cloudflare map[string]CertManagerCloudflareCredential `yaml:"cloudflare,omitempty" json:"cloudflare,omitempty"`

	// Deprecated: legacy flat fields kept for migration compatibility.
	AWSAccessKey       string `yaml:"aws_access_key,omitempty" json:"aws_access_key,omitempty"`
	AWSSecretAccessKey string `yaml:"aws_secret_access_key,omitempty" json:"aws_secret_access_key,omitempty"`
	CloudflareAPIToken string `yaml:"cloudflare_api_token,omitempty" json:"cloudflare_api_token,omitempty"`
}

type CiliumConfig

type CiliumConfig struct {
	Enabled              bool             `yaml:"enabled" json:"enabled"`
	Version              string           `yaml:"version,omitempty" json:"version,omitempty"`
	TunnelMode           string           `yaml:"tunnel_mode,omitempty" json:"tunnel_mode,omitempty" validate:"omitempty,oneof=vxlan geneve disabled"`
	Hubble               bool             `yaml:"hubble" json:"hubble"`
	NetworkPolicy        bool             `yaml:"network_policy" json:"network_policy"`
	OperatorEnabled      bool             `yaml:"operator_enabled" json:"operator_enabled"`
	KubeProxyReplacement bool             `yaml:"kube_proxy_replacement" json:"kube_proxy_replacement"`
	Modules              CNIModulesConfig `yaml:"modules,omitempty" json:"modules,omitempty"`
	// InstallMethod specifies how the CNI should be installed.
	// Valid values: "helm" (default), "kustomize-helm", or "kubespray" for non-OpenStack migration compatibility.
	InstallMethod string `yaml:"install_method,omitempty" json:"install_method,omitempty" validate:"omitempty,oneof=kubespray helm kustomize-helm"`
}

CiliumConfig represents Cilium CNI configuration.

type CinderCsiConfig

type CinderCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

CinderCsiConfig represents OpenStack Cinder CSI driver configuration.

type CloudConfig

type CloudConfig struct {
	OpenStack *OpenStackCloudConfig `yaml:"openstack,omitempty" json:"openstack,omitempty"`
	AWS       *AWSCloudConfig       `yaml:"aws,omitempty" json:"aws,omitempty"`
	GCP       *GCPCloudConfig       `yaml:"gcp,omitempty" json:"gcp,omitempty"`
	Azure     *AzureCloudConfig     `yaml:"azure,omitempty" json:"azure,omitempty"`
	VMware    *VMwareCloudConfig    `yaml:"vmware,omitempty" json:"vmware,omitempty"`
}

CloudConfig represents polymorphic provider-specific configuration. Requirements: 4.1

type ClusterAPIConfig

type ClusterAPIConfig struct {
	Version   string               `yaml:"version" json:"version" validate:"required,semver"`
	Providers ClusterAPIProviders  `yaml:"providers" json:"providers" validate:"required"`
	OpenStack *CAPIOpenStackConfig `yaml:"openstack,omitempty" json:"openstack,omitempty"`
	AWS       *CAPIAWSConfig       `yaml:"aws,omitempty" json:"aws,omitempty"`
	Azure     *CAPIAzureConfig     `yaml:"azure,omitempty" json:"azure,omitempty"`
	VMware    *CAPIVMwareConfig    `yaml:"vmware,omitempty" json:"vmware,omitempty"`
}

ClusterAPIConfig represents Cluster API configuration. Requirements: 10.6

type ClusterAPIProviders

type ClusterAPIProviders struct {
	Infrastructure string `yaml:"infrastructure" json:"infrastructure" validate:"required,oneof=openstack aws azure vsphere vmware metal3"`
	Bootstrap      string `yaml:"bootstrap" json:"bootstrap" validate:"required,oneof=kubeadm"`
	ControlPlane   string `yaml:"control_plane" json:"control_plane" validate:"required,oneof=kubeadm"`
}

ClusterAPIProviders represents Cluster API provider configuration. Requirements: 10.6

type ClusterConfig

type ClusterConfig struct {
	ClusterName string           `yaml:"cluster_name" json:"cluster_name" validate:"required,dns1123"`
	BaseDomain  string           `yaml:"base_domain" json:"base_domain" validate:"required,fqdn"`
	ClusterFQDN string           `yaml:"cluster_fqdn" json:"cluster_fqdn" validate:"required,fqdn"`
	AdminEmail  string           `yaml:"admin_email" json:"admin_email" validate:"required,email"`
	Kubernetes  KubernetesConfig `yaml:"kubernetes" json:"kubernetes" validate:"required"`
}

ClusterConfig represents Kubernetes-specific configuration independent of infrastructure. Requirements: 1.4, 3.2, 9.3, 9.4, 9.5

type ComputeConfig

type ComputeConfig struct {
	// Instance flavors
	FlavorBastion       string `yaml:"flavor_bastion,omitempty" json:"flavor_bastion,omitempty"`
	FlavorMaster        string `yaml:"flavor_master,omitempty" json:"flavor_master,omitempty"`
	FlavorWorker        string `yaml:"flavor_worker,omitempty" json:"flavor_worker,omitempty"`
	FlavorWorkerWindows string `yaml:"flavor_worker_windows,omitempty" json:"flavor_worker_windows,omitempty"`

	// Node counts
	MasterCount        int `yaml:"master_count" json:"master_count" validate:"min=0"`
	WorkerCount        int `yaml:"worker_count" json:"worker_count" validate:"min=0"`
	WorkerCountWindows int `yaml:"worker_count_windows" json:"worker_count_windows" validate:"min=0"`

	// Pre-provisioned node definitions (baremetal/vmware)
	MasterNodes  []StaticNode `yaml:"master_nodes,omitempty" json:"master_nodes,omitempty"`
	WorkerNodes  []StaticNode `yaml:"worker_nodes,omitempty" json:"worker_nodes,omitempty"`
	WindowsNodes []StaticNode `yaml:"windows_nodes,omitempty" json:"windows_nodes,omitempty"`

	// Additional worker pools
	AdditionalServerPoolsWorker []WorkerPoolConfig `yaml:"additional_server_pools_worker,omitempty" json:"additional_server_pools_worker,omitempty"`
}

ComputeConfig represents compute resource configuration. Requirements: 9.1

type Config

type Config struct {
	SchemaVersion string           `yaml:"schema_version" json:"schema_version" validate:"required,eq=2.0"`
	Metadata      ConfigMetadata   `yaml:"metadata,omitempty" json:"metadata,omitempty"`
	OpenCenter    OpenCenterConfig `yaml:"opencenter" json:"opencenter" validate:"required"`
	Deployment    DeploymentConfig `yaml:"deployment,omitempty" json:"deployment,omitempty"`
	OpenTofu      OpenTofuConfig   `yaml:"opentofu,omitempty" json:"opentofu,omitempty" validate:"required"`
	Secrets       SecretsConfig    `yaml:"secrets" json:"secrets" validate:"required"`
}

Config represents the root v2 configuration structure. Requirements: 1.1, 1.3, 1.4, 1.5, 1.6, 1.7

func NewV2Default

func NewV2Default(name, provider string) (*Config, error)

NewV2Default creates a schema-valid v2 configuration with init defaults.

func NewV2FullTemplate

func NewV2FullTemplate(name, provider string) (*Config, error)

NewV2FullTemplate returns a more explicit v2 template for --full-schema output.

func (Config) ClusterName

func (c Config) ClusterName() string

ClusterName returns the cluster's canonical name.

func (Config) ConfiguredGitURL

func (c Config) ConfiguredGitURL() string

ConfiguredGitURL returns the Git URL only when it has been explicitly set to something other than the schema default placeholder.

func (Config) EnabledCertManagerAWSCredentials

func (c Config) EnabledCertManagerAWSCredentials() map[string]CertManagerAWSCredential

EnabledCertManagerAWSCredentials returns all enabled AWS credentials for cert-manager, keyed by their configured name.

func (Config) EnabledCertManagerCloudflareCredentials

func (c Config) EnabledCertManagerCloudflareCredentials() map[string]CertManagerCloudflareCredential

EnabledCertManagerCloudflareCredentials returns all enabled Cloudflare credentials for cert-manager, keyed by their configured name.

func (Config) GetAWSApplicationCredentials

func (c Config) GetAWSApplicationCredentials() (accessKey, secretKey string)

GetAWSApplicationCredentials resolves application credentials with fallback to infrastructure credentials.

func (Config) GetAWSCredentials

func (c Config) GetAWSCredentials(serviceAccessKey, serviceSecretKey string) (accessKey, secretKey string)

GetAWSCredentials resolves service credentials with fallback to infrastructure credentials.

func (Config) GetCertManagerAWSAccessKey

func (c Config) GetCertManagerAWSAccessKey() string

GetCertManagerAWSAccessKey returns the cert-manager AWS access key for templates. Deprecated: Use EnabledCertManagerAWSCredentials() for multi-credential support.

func (Config) GetCertManagerAWSCredentials

func (c Config) GetCertManagerAWSCredentials() (accessKey, secretKey string)

GetCertManagerAWSCredentials resolves cert-manager Route53 credentials. Deprecated: Use EnabledCertManagerAWSCredentials() for multi-credential support.

func (Config) GetCertManagerAWSSecretKey

func (c Config) GetCertManagerAWSSecretKey() string

GetCertManagerAWSSecretKey returns the cert-manager AWS secret key for templates. Deprecated: Use EnabledCertManagerAWSCredentials() for multi-credential support.

func (Config) GetCertManagerCloudflareAPIToken

func (c Config) GetCertManagerCloudflareAPIToken() string

GetCertManagerCloudflareAPIToken returns the Cloudflare API token for cert-manager. Deprecated: Use EnabledCertManagerCloudflareCredentials() for multi-credential support.

func (Config) GetLokiS3AccessKey

func (c Config) GetLokiS3AccessKey() string

GetLokiS3AccessKey returns the Loki S3 access key for templates.

func (Config) GetLokiS3Credentials

func (c Config) GetLokiS3Credentials() (accessKey, secretKey string)

GetLokiS3Credentials resolves Loki S3 credentials.

func (Config) GetLokiS3SecretKey

func (c Config) GetLokiS3SecretKey() string

GetLokiS3SecretKey returns the Loki S3 secret key for templates.

func (Config) GetLokiSwiftApplicationCredentialSecret

func (c Config) GetLokiSwiftApplicationCredentialSecret() string

GetLokiSwiftApplicationCredentialSecret returns the Loki Swift application credential secret.

func (Config) GetS3BackendAccessKey

func (c Config) GetS3BackendAccessKey() string

GetS3BackendAccessKey returns the backend S3 access key for templates.

func (Config) GetS3BackendCredentials

func (c Config) GetS3BackendCredentials() (accessKey, secretKey string)

GetS3BackendCredentials resolves backend S3 credentials using infrastructure credentials.

func (Config) GetS3BackendSecretKey

func (c Config) GetS3BackendSecretKey() string

GetS3BackendSecretKey returns the backend S3 secret key for templates.

func (Config) GetTempoS3AccessKey

func (c Config) GetTempoS3AccessKey() string

GetTempoS3AccessKey returns the Tempo S3 access key for templates.

func (Config) GetTempoS3Credentials

func (c Config) GetTempoS3Credentials() (accessKey, secretKey string)

GetTempoS3Credentials resolves Tempo S3 credentials.

func (Config) GetTempoS3SecretKey

func (c Config) GetTempoS3SecretKey() string

GetTempoS3SecretKey returns the Tempo S3 secret key for templates.

func (Config) GetTempoSwiftApplicationCredentialSecret

func (c Config) GetTempoSwiftApplicationCredentialSecret() string

GetTempoSwiftApplicationCredentialSecret returns the Tempo Swift application credential secret.

func (Config) GitBranchOrDefault

func (c Config) GitBranchOrDefault() string

GitBranchOrDefault returns the configured Git branch, defaulting to main.

func (Config) GitDir

func (c Config) GitDir() string

GitDir returns the configured GitOps working directory.

func (Config) GitOps

func (c Config) GitOps() GitOpsConfig

GitOps returns the GitOps configuration block.

func (Config) IsKind

func (c Config) IsKind() bool

IsKind reports whether the cluster uses the kind provider.

func (Config) KindDisableDefaultCNI

func (c Config) KindDisableDefaultCNI() bool

KindDisableDefaultCNI reports whether kind should disable its default CNI.

func (Config) Organization

func (c Config) Organization() string

Organization returns the cluster organization.

func (Config) Provider

func (c Config) Provider() string

Provider returns the normalized infrastructure provider name.

func (Config) ToJSON

func (c Config) ToJSON() ([]byte, error)

ToJSON marshals the configuration to indented JSON.

type ConfigCache

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

ConfigCache provides thread-safe caching of configurations. It stores loaded configurations in memory to avoid repeated disk reads.

func NewConfigCache

func NewConfigCache() *ConfigCache

NewConfigCache creates a new ConfigCache instance.

func (*ConfigCache) Clear

func (cc *ConfigCache) Clear(ctx context.Context)

Clear removes all entries from cache.

func (*ConfigCache) Get

func (cc *ConfigCache) Get(ctx context.Context, name string) (*Config, bool)

Get retrieves a configuration from cache. Returns the cached config and true if found and not expired, nil and false otherwise.

func (*ConfigCache) Invalidate

func (cc *ConfigCache) Invalidate(ctx context.Context, name string)

Invalidate removes a specific entry from cache.

func (*ConfigCache) Set

func (cc *ConfigCache) Set(ctx context.Context, name string, config *Config)

Set stores a configuration in cache with optional expiration. If expiration is zero, the entry never expires.

func (*ConfigCache) SetWithExpiration

func (cc *ConfigCache) SetWithExpiration(ctx context.Context, name string, config *Config, expiresAt time.Time)

SetWithExpiration stores a configuration in cache with a specific expiration time.

func (*ConfigCache) Size

func (cc *ConfigCache) Size() int

Size returns the number of cached entries.

type ConfigIOHandler

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

ConfigIOHandler handles configuration file I/O operations. It provides methods for loading and saving configurations using the FileSystem interface for atomic operations.

func NewConfigIOHandler

func NewConfigIOHandler(fileSystem fs.FileSystem) *ConfigIOHandler

NewConfigIOHandler creates a new ConfigIOHandler with the given FileSystem.

func (*ConfigIOHandler) LoadFromBytes

func (cl *ConfigIOHandler) LoadFromBytes(ctx context.Context, data []byte) (*Config, error)

LoadFromBytes parses configuration data from a byte slice. It unmarshals the YAML content into a Config struct.

Parameters:

  • ctx: Context for cancellation and timeouts
  • data: YAML configuration data as bytes

Returns:

  • *Config: The parsed configuration
  • error: An error if the data cannot be parsed

func (*ConfigIOHandler) LoadFromFile

func (cl *ConfigIOHandler) LoadFromFile(ctx context.Context, path string) (*Config, error)

LoadFromFile reads and parses a configuration file from the given path. It uses the FileSystem interface to read the file and then unmarshals the YAML content into a Config struct.

Parameters:

  • ctx: Context for cancellation and timeouts
  • path: Absolute path to the configuration file

Returns:

  • *Config: The parsed configuration
  • error: An error if the file cannot be read or parsed

func (*ConfigIOHandler) MarshalConfig

func (cl *ConfigIOHandler) MarshalConfig(config *Config) ([]byte, error)

MarshalConfig converts a Config struct to YAML bytes. It uses gopkg.in/yaml.v3 for marshaling.

Parameters:

  • config: The configuration to marshal

Returns:

  • []byte: The YAML-encoded configuration
  • error: An error if marshaling fails

func (*ConfigIOHandler) SaveToFile

func (cl *ConfigIOHandler) SaveToFile(ctx context.Context, path string, config *Config) error

SaveToFile writes a configuration to a file atomically. It uses FileSystem.WriteFileAtomic to ensure the write operation is atomic and prevents corruption from partial writes.

Parameters:

  • ctx: Context for cancellation and timeouts
  • path: Absolute path where the configuration should be saved
  • config: The configuration to save

Returns:

  • error: An error if the configuration cannot be marshaled or written

func (*ConfigIOHandler) UnmarshalConfig

func (cl *ConfigIOHandler) UnmarshalConfig(data []byte) (*Config, error)

UnmarshalConfig parses YAML bytes into a Config struct. It uses gopkg.in/yaml.v3 for unmarshaling.

Parameters:

  • data: YAML configuration data as bytes

Returns:

  • *Config: The parsed configuration
  • error: An error if unmarshaling fails

func (*ConfigIOHandler) ValidateConfig

func (cl *ConfigIOHandler) ValidateConfig(ctx context.Context, config *Config) error

ValidateConfig validates a native v2 configuration through the same load/normalize/default/validate pipeline used for persisted files.

type ConfigLoader

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

ConfigLoader implements the v2 configuration loading pipeline. Pipeline: Load YAML → Normalize → Resolve References → Apply Defaults → Validate → Freeze Requirements: 6.3, 15.1

func NewConfigLoader

func NewConfigLoader(registry defaults.Registry) *ConfigLoader

NewConfigLoader creates a new v2 configuration loader with all pipeline components.

func NewConfigLoaderWithFileSystem

func NewConfigLoaderWithFileSystem(registry defaults.Registry, fileSystem fs.FileSystem) *ConfigLoader

NewConfigLoaderWithFileSystem creates a new v2 configuration loader with an explicit filesystem. This keeps higher-level managers testable while using the same native v2 pipeline for every load/save/validate operation.

func (*ConfigLoader) ExportEffectiveConfig

func (cl *ConfigLoader) ExportEffectiveConfig(cfg *Config) ([]byte, error)

ExportEffectiveConfig exports the configuration with applied defaults as comments. Requirements: 15.7, 15.8

func (*ConfigLoader) GetAppliedDefaults

func (cl *ConfigLoader) GetAppliedDefaults() map[string]defaults.DefaultSource

GetAppliedDefaults returns the defaults that were applied during hydration. Requirements: 15.6, 15.7

func (*ConfigLoader) LoadFromBytes

func (cl *ConfigLoader) LoadFromBytes(data []byte) (*Config, error)

LoadFromBytes loads a v2 configuration from byte data. It executes the complete pipeline: Load → Normalize → Resolve → Hydrate → Validate → Freeze. Requirements: 6.3, 15.1

func (*ConfigLoader) LoadFromFile

func (cl *ConfigLoader) LoadFromFile(filePath string) (*Config, error)

LoadFromFile loads a v2 configuration from a file path. It executes the complete pipeline: Load → Normalize → Resolve → Hydrate → Validate → Freeze. Requirements: 6.3, 15.1

func (*ConfigLoader) SaveToFile

func (cl *ConfigLoader) SaveToFile(cfg *Config, filePath string) error

SaveToFile saves a v2 configuration to a file. Requirements: 16.2

type ConfigMetadata

type ConfigMetadata struct {
	CreatedAt   string            `yaml:"created_at,omitempty" json:"created_at,omitempty"`
	UpdatedAt   string            `yaml:"updated_at,omitempty" json:"updated_at,omitempty"`
	CreatedBy   string            `yaml:"created_by,omitempty" json:"created_by,omitempty"`
	Version     string            `yaml:"version,omitempty" json:"version,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
}

ConfigMetadata holds system-managed metadata about the configuration.

type ConfigNotFoundError

type ConfigNotFoundError struct {
	ClusterName string
	Err         error
}

ConfigNotFoundError is a sentinel error type indicating that a cluster configuration directory or file does not exist. Commands that encounter this error should exit with code 3 so CI/CD pipelines can distinguish missing-configuration failures from general errors.

func NewConfigNotFoundError

func NewConfigNotFoundError(clusterName string, cause error) *ConfigNotFoundError

NewConfigNotFoundError creates a ConfigNotFoundError for the given cluster name.

func (*ConfigNotFoundError) Error

func (e *ConfigNotFoundError) Error() string

Error implements the error interface.

func (*ConfigNotFoundError) Unwrap

func (e *ConfigNotFoundError) Unwrap() error

Unwrap returns the underlying error for errors.Is/errors.As compatibility.

type ConfigurationManager

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

ConfigurationManager provides unified configuration management. It orchestrates all configuration operations including loading, saving, validation, listing, and deletion with caching and atomic operations.

The manager integrates with:

  • ConfigCache: Thread-safe in-memory caching
  • ConfigIOHandler: Low-level I/O operations
  • ValidationEngine: Configuration validation (Phase 2)
  • PathResolver: Path resolution (Phase 1)
  • FileSystem: Atomic file operations (Phase 1)

Example usage:

manager, err := NewConfigurationManager()
if err != nil {
    return err

// Load configuration with caching
config, err := manager.Load(ctx, "my-cluster")
if err != nil {
    return err

// Save with validation and atomic writes
err = manager.Save(ctx, config)

func NewConfigurationManagerWithDeps

func NewConfigurationManagerWithDeps(
	loader *ConfigIOHandler,
	validator *validation.ValidationEngine,
	cache *ConfigCache,
	pathResolver *paths.PathResolver,
	fileSystem fs.FileSystem,
) *ConfigurationManager

NewConfigurationManagerWithDeps creates a ConfigurationManager with custom dependencies.

This constructor is useful for testing or when custom components are needed.

Parameters:

  • loader: ConfigIOHandler for file I/O
  • validator: ValidationEngine for validation
  • cache: ConfigCache for caching
  • pathResolver: PathResolver for path resolution
  • fileSystem: FileSystem for file operations

Returns:

  • *ConfigurationManager: New manager instance

func (*ConfigurationManager) ClearCache

func (cm *ConfigurationManager) ClearCache(ctx context.Context) error

ClearCache removes all cached configurations.

Example:

manager.ClearCache(ctx)

func (*ConfigurationManager) Delete

func (cm *ConfigurationManager) Delete(ctx context.Context, name string) error

Delete removes a configuration file.

The delete process:

  1. Resolve configuration file path
  2. Create backup of the file
  3. Remove the configuration file
  4. Invalidate cache entry

Parameters:

  • ctx: Context for cancellation and timeouts
  • name: Cluster name to delete

Returns:

  • error: Path resolution, backup, or deletion error

Example:

err := manager.Delete(ctx, "old-cluster")
if err != nil {
    return fmt.Errorf("failed to delete: %w", err)

func (*ConfigurationManager) GetActive

func (cm *ConfigurationManager) GetActive() (string, error)

GetActive returns the active cluster name with precedence: 1. OPENCENTER_CLUSTER environment variable (session-scoped) 2. Session file (if shell integration is active) 3. Persistent selection from marker file

Returns:

  • string: The active cluster name (empty string if none set)
  • error: File read error

Example:

active, err := manager.GetActive()
if err != nil {
    return err
if active == "" {
    fmt.Println("No active cluster")

func (*ConfigurationManager) InvalidateCluster

func (cm *ConfigurationManager) InvalidateCluster(ctx context.Context, name string) error

InvalidateCluster removes a specific cluster from cache.

Parameters:

  • ctx: Context for cancellation
  • name: Cluster name to invalidate

Example:

manager.InvalidateCluster(ctx, "my-cluster")

func (*ConfigurationManager) List

func (cm *ConfigurationManager) List(ctx context.Context) ([]string, error)

List returns all cluster names in the configuration directory.

The method scans the base directory for organization subdirectories and returns all cluster names found.

Parameters:

  • ctx: Context for cancellation and timeouts

Returns:

  • []string: List of cluster names (empty if none found)
  • error: Directory read error

Example:

clusters, err := manager.List(ctx)
if err != nil {
    return err
for _, cluster := range clusters {
    fmt.Println(cluster)

func (*ConfigurationManager) ListWithOrganization

func (cm *ConfigurationManager) ListWithOrganization(ctx context.Context, organization string) ([]string, error)

ListWithOrganization returns cluster names filtered by organization.

If organization is empty, returns clusters from all organizations.

Parameters:

  • ctx: Context for cancellation and timeouts
  • organization: Organization name to filter by (empty for all)

Returns:

  • []string: Sorted list of cluster names
  • error: Directory read error

Example:

clusters, err := manager.ListWithOrganization(ctx, "my-org")

func (*ConfigurationManager) Load

func (cm *ConfigurationManager) Load(ctx context.Context, name string) (*Config, error)

Load loads a configuration from disk or cache.

The load process follows these steps:

  1. Check cache for existing configuration (fast path)
  2. Resolve configuration file path using PathResolver
  3. Read and parse configuration file
  4. Validate configuration using ValidationEngine
  5. Store in cache for future loads

Parameters:

  • ctx: Context for cancellation and timeouts
  • name: Cluster name to load

Returns:

  • *Config: Loaded and validated configuration
  • error: Load, parse, or validation error

Example:

config, err := manager.Load(ctx, "prod-cluster")
if err != nil {
    return fmt.Errorf("failed to load config: %w", err)

func (*ConfigurationManager) LoadWithoutValidation

func (cm *ConfigurationManager) LoadWithoutValidation(ctx context.Context, name string) (*Config, error)

LoadWithoutValidation loads a configuration from disk or cache without validation.

This method is primarily intended for testing scenarios where you need to load incomplete or invalid configurations. In production code, use Load() instead.

The load process follows these steps:

  1. Check cache for existing configuration (fast path)
  2. Resolve configuration file path using PathResolver
  3. Read and parse configuration file
  4. Store in cache for future loads (NO VALIDATION)

Parameters:

  • ctx: Context for cancellation and timeouts
  • name: Cluster name to load

Returns:

  • *Config: Loaded configuration (not validated)
  • error: Load or parse error

Example:

config, err := manager.LoadWithoutValidation(ctx, "test-cluster")
if err != nil {
    return fmt.Errorf("failed to load config: %w", err)

func (*ConfigurationManager) Save

func (cm *ConfigurationManager) Save(ctx context.Context, config *Config) error

Save saves a configuration to disk atomically.

The save process follows these steps:

  1. Validate configuration using ValidationEngine
  2. Resolve configuration file path
  3. Create backup of existing file (if exists)
  4. Write configuration atomically using FileSystem
  5. Invalidate cache entry for this cluster

Parameters:

  • ctx: Context for cancellation and timeouts
  • config: Configuration to save

Returns:

  • error: Validation, path resolution, or write error

Example:

err := manager.Save(ctx, config)
if err != nil {
    return fmt.Errorf("failed to save config: %w", err)

func (*ConfigurationManager) SaveWithoutValidation

func (cm *ConfigurationManager) SaveWithoutValidation(ctx context.Context, config *Config) error

SaveWithoutValidation saves a configuration to disk atomically without validation.

This method is primarily intended for testing scenarios where you need to save incomplete or invalid configurations. In production code, use Save() instead.

The save process follows these steps:

  1. Resolve configuration file path
  2. Create backup of existing file (if exists)
  3. Write configuration atomically using FileSystem
  4. Invalidate cache entry for this cluster

Parameters:

  • ctx: Context for cancellation and timeouts
  • config: Configuration to save

Returns:

  • error: Path resolution or write error

Example:

err := manager.SaveWithoutValidation(ctx, config)
if err != nil {
    return fmt.Errorf("failed to save config: %w", err)

func (*ConfigurationManager) SetActive

func (cm *ConfigurationManager) SetActive(name string) error

SetActive writes the given cluster name into the active marker file. If the name is empty, the marker file is removed.

Parameters:

  • name: The name of the cluster to set as active (empty to clear)

Returns:

  • error: File write error

Example:

// Set active cluster
err := manager.SetActive("my-cluster")

// Clear active cluster
err := manager.SetActive("")

func (*ConfigurationManager) Validate

func (cm *ConfigurationManager) Validate(ctx context.Context, config *Config) error

Validate validates a configuration without saving.

This method is useful for checking configuration validity before attempting to save or for validating configurations from other sources.

Parameters:

  • ctx: Context for cancellation and timeouts
  • config: Configuration to validate

Returns:

  • error: Validation error (nil if valid)

Example:

err := manager.Validate(ctx, config)
if err != nil {
    fmt.Println("Configuration is invalid:", err)

type DeploymentConfig

type DeploymentConfig struct {
	AutoDeploy bool              `yaml:"auto_deploy" json:"auto_deploy"`
	Method     string            `yaml:"method" json:"method" validate:"required,oneof=kubespray kamaji eks gke aks cluster-api"`
	Kubespray  *KubesprayConfig  `yaml:"kubespray,omitempty" json:"kubespray,omitempty"`
	Kamaji     *KamajiConfig     `yaml:"kamaji,omitempty" json:"kamaji,omitempty"`
	ClusterAPI *ClusterAPIConfig `yaml:"cluster_api,omitempty" json:"cluster_api,omitempty"`
}

DeploymentConfig represents deployment method configuration. Requirements: 5.1, 5.2, 5.3, 5.4, 5.5

type DeploymentMethod

type DeploymentMethod interface {
	ValidateConfig(cfg *Config) error
	ValidateCompatibility(provider string) error
	GetMethodName() string
	RequiresMasterNodes() bool
}

DeploymentMethod interface defines deployment-method-specific validation. Requirements: 5.6, 5.7, 5.8, 10.9, 10.10, 10.11, 10.12

func GetDeploymentMethod

func GetDeploymentMethod(methodName string) (DeploymentMethod, error)

GetDeploymentMethod returns the appropriate deployment method validator.

type DesignateConfig

type DesignateConfig struct {
	DNSZoneName string `yaml:"dns_zone_name,omitempty" json:"dns_zone_name,omitempty"`
}

type GCPCloudConfig

type GCPCloudConfig struct {
	Project           string   `yaml:"project" json:"project" validate:"required"`
	Region            string   `yaml:"region" json:"region" validate:"required"`
	Zone              string   `yaml:"zone,omitempty" json:"zone,omitempty"`
	Network           string   `yaml:"network" json:"network" validate:"required"`
	Subnetwork        string   `yaml:"subnetwork" json:"subnetwork" validate:"required"`
	ImageFamily       string   `yaml:"image_family" json:"image_family" validate:"required"`
	AvailabilityZones []string `yaml:"availability_zones,omitempty" json:"availability_zones,omitempty"`
}

GCPCloudConfig represents GCP-specific configuration. Requirements: 4.5

type GCPProvider

type GCPProvider struct{}

GCPProvider implements provider validation for GCP. Requirements: 4.5

func (*GCPProvider) GetProviderName

func (p *GCPProvider) GetProviderName() string

GetProviderName returns the provider name.

func (*GCPProvider) ValidateConfig

func (p *GCPProvider) ValidateConfig(cfg *InfrastructureConfig) error

ValidateConfig validates GCP-specific configuration.

type GcpComputeCsiConfig

type GcpComputeCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

GcpComputeCsiConfig represents GCP Compute CSI driver configuration.

type GitOpsAuth

type GitOpsAuth struct {
	// SSH holds SSH key authentication settings.
	SSH *GitOpsSSHAuth `yaml:"ssh,omitempty" json:"ssh,omitempty"`

	// Token holds token-based authentication settings.
	Token *GitOpsTokenAuth `yaml:"token,omitempty" json:"token,omitempty"`
}

GitOpsAuth holds authentication configuration.

type GitOpsBaseRepo

type GitOpsBaseRepo struct {
	// URL is the base GitOps templates repository.
	URL string `yaml:"url,omitempty" json:"url,omitempty" validate:"omitempty,url"`

	// Release is the version tag to use (e.g., v0.1.0).
	Release string `yaml:"release,omitempty" json:"release,omitempty"`

	// Branch is the branch to track (alternative to Release).
	Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
}

GitOpsBaseRepo holds upstream template repository settings.

type GitOpsConfig

type GitOpsConfig struct {
	// Repository holds cluster-specific GitOps repository settings.
	Repository GitOpsRepository `yaml:"repository" json:"repository" validate:"required"`

	// BaseRepo holds upstream template repository settings.
	BaseRepo GitOpsBaseRepo `yaml:"base_repo,omitempty" json:"base_repo,omitempty"`

	// Auth holds authentication configuration (SSH or Token).
	Auth GitOpsAuth `yaml:"auth,omitempty" json:"auth,omitempty"`

	// Flux holds FluxCD reconciliation settings.
	Flux GitOpsFluxConfig `yaml:"flux,omitempty" json:"flux,omitempty"`

	// OverlayUnits holds service overlay customization.
	OverlayUnits overlaycfg.UnitsConfig `yaml:"overlay_units,omitempty" json:"overlay_units,omitempty"`
}

GitOpsConfig represents GitOps repository and FluxCD configuration. Requirements: 19.1

type GitOpsFluxConfig

type GitOpsFluxConfig struct {
	Interval string `yaml:"interval,omitempty" json:"interval,omitempty"`
	Prune    bool   `yaml:"prune" json:"prune"`
}

type GitOpsRepository

type GitOpsRepository struct {
	// URL is the remote repository URL (SSH or HTTPS).
	URL string `yaml:"url" json:"url" validate:"required,url"`

	// Branch is the target branch (default: main).
	Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`

	// Path is the directory within the repo for this cluster's manifests.
	Path string `yaml:"path,omitempty" json:"path,omitempty"`

	// LocalDir is the local checkout directory.
	LocalDir string `yaml:"local_dir,omitempty" json:"local_dir,omitempty"`

	// SecretName is the K8s secret name for repository access.
	SecretName string `yaml:"secret_name,omitempty" json:"secret_name,omitempty"`
}

GitOpsRepository holds cluster-specific repository settings.

type GitOpsSSHAuth

type GitOpsSSHAuth struct {
	// PrivateKey is the path to the SSH private key file.
	PrivateKey string `yaml:"private_key,omitempty" json:"private_key,omitempty"`

	// PublicKey is the path to the SSH public key file.
	PublicKey string `yaml:"public_key,omitempty" json:"public_key,omitempty"`
}

GitOpsSSHAuth holds SSH key authentication settings.

type GitOpsTokenAuth

type GitOpsTokenAuth struct {
	// Provider is the Git provider: github, gitlab, gitea.
	Provider string `yaml:"provider" json:"provider" validate:"required,oneof=github gitlab gitea"`

	// Token is an inline access token value.
	Token string `yaml:"token,omitempty" json:"token,omitempty"`

	// TokenFile is the path to the file containing the access token.
	// Required when using token authentication for bootstrap.
	TokenFile string `yaml:"token_file,omitempty" json:"token_file,omitempty"`

	// Owner is the repository owner (username or organization).
	// If empty, extracted from repository URL.
	Owner string `yaml:"owner,omitempty" json:"owner,omitempty"`

	// Organization is the git organization used as the username in
	// authenticated HTTPS URLs (e.g., https://<organization>:<token>@host/path).
	Organization string `yaml:"organization,omitempty" json:"organization,omitempty"`
}

GitOpsTokenAuth holds token-based authentication settings.

type GlobalSecrets

type GlobalSecrets struct {
	AWS                AWSGlobalSecrets `yaml:"aws,omitempty" json:"aws,omitempty"`
	AWSAccessKey       string           `yaml:"aws_access_key,omitempty" json:"aws_access_key,omitempty"`
	AWSSecretKey       string           `yaml:"aws_secret_key,omitempty" json:"aws_secret_key,omitempty"`
	OpenStackAuthURL   string           `yaml:"openstack_auth_url,omitempty" json:"openstack_auth_url,omitempty"`
	OpenStackUsername  string           `yaml:"openstack_username,omitempty" json:"openstack_username,omitempty"`
	OpenStackPassword  string           `yaml:"openstack_password,omitempty" json:"openstack_password,omitempty"`
	OpenStackProjectID string           `yaml:"openstack_project_id,omitempty" json:"openstack_project_id,omitempty"`
}

GlobalSecrets holds infrastructure-wide credentials. Requirements: 18.2

type GrafanaSecrets

type GrafanaSecrets struct {
	AdminPassword string `yaml:"admin_password,omitempty" json:"admin_password,omitempty"`
}

type HeadlampSecrets

type HeadlampSecrets struct {
	OIDCClientSecret string `yaml:"oidc_client_secret,omitempty" json:"oidc_client_secret,omitempty"`
}

type IdentityConfig

type IdentityConfig struct {
	OIDC IdentityOIDCConfig `yaml:"oidc,omitempty" json:"oidc,omitempty"`
}

type IdentityOIDCConfig

type IdentityOIDCConfig struct {
	Enabled  bool   `yaml:"enabled" json:"enabled"`
	Source   string `yaml:"source,omitempty" json:"source,omitempty" validate:"omitempty,oneof=internal external"`
	Provider string `yaml:"provider,omitempty" json:"provider,omitempty" validate:"omitempty,oneof=keycloak entra generic"`
}

type InfrastructureConfig

type InfrastructureConfig struct {
	Provider            string                   `yaml:"provider" json:"provider" validate:"required,oneof=openstack aws gcp azure baremetal vsphere vmware kind"`
	SSH                 SSHConfig                `yaml:"ssh" json:"ssh" validate:"required"`
	OSVersion           string                   `yaml:"os_version" json:"os_version" validate:"required"`
	ServerGroupAffinity []string                 `yaml:"server_group_affinity,omitempty" json:"server_group_affinity,omitempty"`
	K8sAPIIP            string                   `yaml:"k8s_api_ip,omitempty" json:"k8s_api_ip,omitempty" validate:"omitempty,ipv4"`
	NodeNaming          NodeNamingConfig         `yaml:"node_naming,omitempty" json:"node_naming,omitempty"`
	Bastion             BastionConfig            `yaml:"bastion,omitempty" json:"bastion,omitempty"`
	Networking          NetworkingConfig         `yaml:"networking" json:"networking" validate:"required"`
	Compute             ComputeConfig            `yaml:"compute" json:"compute" validate:"required"`
	Storage             StorageConfig            `yaml:"storage" json:"storage" validate:"required"`
	Cloud               CloudConfig              `yaml:"cloud" json:"cloud" validate:"required"`
	Kind                *KindCompatibilityConfig `yaml:"kind,omitempty" json:"kind,omitempty"`
}

InfrastructureConfig represents provider-agnostic infrastructure with provider-specific extensions. Requirements: 2.1, 3.1, 4.1, 9.1, 9.2

type KamajiConfig

type KamajiConfig struct {
	Enabled      bool                    `yaml:"enabled" json:"enabled"`
	Version      string                  `yaml:"version" json:"version" validate:"required_if=Enabled true,omitempty,semver"`
	ControlPlane KamajiControlPlane      `yaml:"control_plane" json:"control_plane" validate:"required_if=Enabled true"`
	ClusterAPI   ClusterAPIConfig        `yaml:"cluster_api" json:"cluster_api" validate:"required_if=Enabled true"`
	WorkerPools  []KamajiWorkerPool      `yaml:"worker_pools" json:"worker_pools" validate:"required_if=Enabled true,min=1,dive"`
	Modules      map[string]ModuleConfig `yaml:"modules,omitempty" json:"modules,omitempty"`
}

KamajiConfig represents Kamaji hosted control plane configuration. Requirements: 5.4, 5.5, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8

type KamajiControlPlane

type KamajiControlPlane struct {
	Replicas      int                     `yaml:"replicas" json:"replicas" validate:"required,oneof=1 3 5 7"`
	Datastore     string                  `yaml:"datastore" json:"datastore" validate:"required,oneof=etcd postgresql mysql"`
	Etcd          *KamajiEtcdConfig       `yaml:"etcd,omitempty" json:"etcd,omitempty"`
	PostgreSQL    *KamajiPostgreSQLConfig `yaml:"postgresql,omitempty" json:"postgresql,omitempty"`
	MySQL         *KamajiMySQLConfig      `yaml:"mysql,omitempty" json:"mysql,omitempty"`
	ServiceType   string                  `yaml:"service_type" json:"service_type" validate:"required,oneof=LoadBalancer NodePort"`
	APIServerPort int                     `yaml:"api_server_port" json:"api_server_port" validate:"required,min=1,max=65535"`
	Resources     KamajiResourcesConfig   `yaml:"resources,omitempty" json:"resources,omitempty"`
}

KamajiControlPlane represents Kamaji control plane configuration. Requirements: 10.2, 10.3, 10.4

type KamajiDeployment

type KamajiDeployment struct{}

KamajiDeployment implements deployment validation for Kamaji. Requirements: 5.8, 10.9, 10.10, 10.11, 10.12

func (*KamajiDeployment) GetMethodName

func (d *KamajiDeployment) GetMethodName() string

GetMethodName returns the deployment method name.

func (*KamajiDeployment) RequiresMasterNodes

func (d *KamajiDeployment) RequiresMasterNodes() bool

RequiresMasterNodes returns whether this deployment method requires master nodes.

func (*KamajiDeployment) ValidateCompatibility

func (d *KamajiDeployment) ValidateCompatibility(provider string) error

ValidateCompatibility validates Kamaji compatibility with infrastructure provider.

func (*KamajiDeployment) ValidateConfig

func (d *KamajiDeployment) ValidateConfig(cfg *Config) error

ValidateConfig validates Kamaji deployment configuration.

type KamajiEtcdConfig

type KamajiEtcdConfig struct {
	StorageClass string `yaml:"storage_class" json:"storage_class" validate:"required"`
	StorageSize  string `yaml:"storage_size" json:"storage_size" validate:"required"`
	Replicas     int    `yaml:"replicas,omitempty" json:"replicas,omitempty" validate:"omitempty,oneof=1 3 5 7"`
}

KamajiEtcdConfig represents Kamaji etcd datastore configuration. Requirements: 10.4

type KamajiMySQLConfig

type KamajiMySQLConfig struct {
	Host     string `yaml:"host" json:"host" validate:"required,hostname|ip"`
	Port     int    `yaml:"port,omitempty" json:"port,omitempty" validate:"omitempty,min=1,max=65535"`
	Database string `yaml:"database" json:"database" validate:"required"`
	Username string `yaml:"username,omitempty" json:"username,omitempty"`
}

KamajiMySQLConfig represents Kamaji MySQL datastore configuration.

type KamajiPostgreSQLConfig

type KamajiPostgreSQLConfig struct {
	Host     string `yaml:"host" json:"host" validate:"required,hostname|ip"`
	Port     int    `yaml:"port,omitempty" json:"port,omitempty" validate:"omitempty,min=1,max=65535"`
	Database string `yaml:"database" json:"database" validate:"required"`
	Username string `yaml:"username,omitempty" json:"username,omitempty"`
	SSLMode  string `yaml:"ssl_mode,omitempty" json:"ssl_mode,omitempty" validate:"omitempty,oneof=disable require verify-ca verify-full"`
}

KamajiPostgreSQLConfig represents Kamaji PostgreSQL datastore configuration. Requirements: 10.5

type KamajiResourcesConfig

type KamajiResourcesConfig struct {
	CPURequest    string `yaml:"cpu_request,omitempty" json:"cpu_request,omitempty"`
	CPULimit      string `yaml:"cpu_limit,omitempty" json:"cpu_limit,omitempty"`
	MemoryRequest string `yaml:"memory_request,omitempty" json:"memory_request,omitempty"`
	MemoryLimit   string `yaml:"memory_limit,omitempty" json:"memory_limit,omitempty"`
}

KamajiResourcesConfig represents Kamaji control plane resource configuration.

type KamajiWorkerPool

type KamajiWorkerPool struct {
	Name              string            `yaml:"name" json:"name" validate:"required,dns1123"`
	OS                string            `yaml:"os" json:"os" validate:"required,oneof=ubuntu windows"`
	Count             int               `yaml:"count" json:"count" validate:"required,min=1"`
	Flavor            string            `yaml:"flavor" json:"flavor" validate:"required"`
	Image             string            `yaml:"image" json:"image" validate:"required"`
	BootstrapProvider string            `yaml:"bootstrap_provider" json:"bootstrap_provider" validate:"required,oneof=kubeadm"`
	BootVolume        VolumeConfig      `yaml:"boot_volume" json:"boot_volume" validate:"required"`
	AdditionalVolumes []VolumeConfig    `yaml:"additional_volumes,omitempty" json:"additional_volumes,omitempty"`
	Labels            map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	Taints            []TaintConfig     `yaml:"taints,omitempty" json:"taints,omitempty"`
	Autoscaling       AutoscalingConfig `yaml:"autoscaling,omitempty" json:"autoscaling,omitempty"`
}

KamajiWorkerPool represents a Kamaji worker pool configuration. Requirements: 10.7, 10.8

type KeycloakSecrets

type KeycloakSecrets struct {
	ClientSecret  string `yaml:"client_secret,omitempty" json:"client_secret,omitempty"`
	AdminPassword string `yaml:"admin_password,omitempty" json:"admin_password,omitempty"`
}

type KindCompatibilityConfig

type KindCompatibilityConfig struct {
	ClusterNameOverride  string             `yaml:"cluster_name,omitempty" json:"cluster_name,omitempty"`
	KubernetesVersion    string             `yaml:"kubernetes_version,omitempty" json:"kubernetes_version,omitempty"`
	NodeImage            string             `yaml:"node_image,omitempty" json:"node_image,omitempty"`
	ControlPlaneCount    int                `yaml:"control_plane_count,omitempty" json:"control_plane_count,omitempty"`
	WorkerCount          int                `yaml:"worker_count,omitempty" json:"worker_count,omitempty"`
	APIServerAddress     string             `yaml:"api_server_address,omitempty" json:"api_server_address,omitempty"`
	APIServerPort        int                `yaml:"api_server_port,omitempty" json:"api_server_port,omitempty"`
	PodSubnet            string             `yaml:"pod_subnet,omitempty" json:"pod_subnet,omitempty"`
	ServiceSubnet        string             `yaml:"service_subnet,omitempty" json:"service_subnet,omitempty"`
	DisableDefaultCNI    bool               `yaml:"disable_default_cni" json:"disable_default_cni"`
	IngressEnabled       bool               `yaml:"ingress_enabled,omitempty" json:"ingress_enabled,omitempty"`
	Runtime              string             `yaml:"runtime,omitempty" json:"runtime,omitempty"`
	KubeconfigPathPolicy string             `yaml:"kubeconfig_path_policy,omitempty" json:"kubeconfig_path_policy,omitempty"`
	Registry             KindRegistryConfig `yaml:"registry,omitempty" json:"registry,omitempty"`
	ExtraPortMappings    []KindPortMapping  `yaml:"extra_port_mappings,omitempty" json:"extra_port_mappings,omitempty"`
	ExtraMounts          []KindMount        `yaml:"extra_mounts,omitempty" json:"extra_mounts,omitempty"`
}

KindCompatibilityConfig carries Kind-specific settings that do not have a provider-agnostic v2 home yet but still need to round-trip through native v2 files.

type KindMount

type KindMount struct {
	HostPath      string `yaml:"host_path,omitempty" json:"host_path,omitempty"`
	ContainerPath string `yaml:"container_path,omitempty" json:"container_path,omitempty"`
	ReadOnly      bool   `yaml:"read_only,omitempty" json:"read_only,omitempty"`
}

KindMount describes an extra host path mount for Kind nodes.

type KindPortMapping

type KindPortMapping struct {
	ContainerPort int    `yaml:"container_port,omitempty" json:"container_port,omitempty"`
	HostPort      int    `yaml:"host_port,omitempty" json:"host_port,omitempty"`
	ListenAddress string `yaml:"listen_address,omitempty" json:"listen_address,omitempty"`
	Protocol      string `yaml:"protocol,omitempty" json:"protocol,omitempty"`
}

KindPortMapping describes an extra host-to-node port mapping for Kind nodes.

type KindRegistryConfig

type KindRegistryConfig struct {
	Enabled bool   `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Name    string `yaml:"name,omitempty" json:"name,omitempty"`
	Port    int    `yaml:"port,omitempty" json:"port,omitempty"`
}

KindRegistryConfig describes the optional local registry wired into a Kind cluster.

type KubeOVNConfig

type KubeOVNConfig struct {
	Enabled           bool             `yaml:"enabled" json:"enabled"`
	Version           string           `yaml:"version,omitempty" json:"version,omitempty"`
	NetworkPolicy     bool             `yaml:"network_policy" json:"network_policy"`
	CiliumIntegration bool             `yaml:"cilium_integration" json:"cilium_integration"`
	Modules           CNIModulesConfig `yaml:"modules,omitempty" json:"modules,omitempty"`
	// InstallMethod specifies how the CNI should be installed.
	// Valid values: "helm" (default), "kustomize-helm", or "kubespray" for non-OpenStack migration compatibility.
	InstallMethod string `yaml:"install_method,omitempty" json:"install_method,omitempty" validate:"omitempty,oneof=kubespray helm kustomize-helm"`
}

KubeOVNConfig represents Kube-OVN CNI configuration.

type KubernetesConfig

type KubernetesConfig struct {
	Version                  string                   `yaml:"version" json:"version" validate:"required,semver"`
	APIPort                  int                      `yaml:"api_port" json:"api_port" validate:"required,min=1,max=65535"`
	KubeVIPEnabled           bool                     `yaml:"kube_vip_enabled" json:"kube_vip_enabled"`
	KubeletRotateServerCerts bool                     `yaml:"kubelet_rotate_server_certs" json:"kubelet_rotate_server_certs"`
	SubnetPods               string                   `yaml:"subnet_pods" json:"subnet_pods" validate:"required,cidrv4"`
	SubnetServices           string                   `yaml:"subnet_services" json:"subnet_services" validate:"required,cidrv4"`
	NetworkPlugin            NetworkPluginConfig      `yaml:"network_plugin" json:"network_plugin" validate:"required"`
	StoragePlugin            StoragePluginConfig      `yaml:"storage_plugin,omitempty" json:"storage_plugin,omitempty"`
	Security                 KubernetesSecurityConfig `yaml:"security,omitempty" json:"security,omitempty"`
	OIDC                     OIDCConfig               `yaml:"oidc,omitempty" json:"oidc,omitempty"`
}

KubernetesConfig represents Kubernetes cluster configuration. Requirements: 3.2, 9.3, 9.4

type KubernetesSecurityConfig

type KubernetesSecurityConfig struct {
	PodSecurityPolicy     bool     `yaml:"pod_security_policy" json:"pod_security_policy"`
	PodSecurityStandards  string   `` /* 137-byte string literal not displayed */
	PodSecurityExemptions []string `yaml:"pod_security_exemptions,omitempty" json:"pod_security_exemptions,omitempty"`
	AuditLogging          bool     `yaml:"audit_logging" json:"audit_logging"`
	EncryptionAtRest      bool     `yaml:"encryption_at_rest" json:"encryption_at_rest"`
	AdmissionControllers  []string `yaml:"admission_controllers,omitempty" json:"admission_controllers,omitempty"`
	K8sHardening          bool     `yaml:"k8s_hardening" json:"k8s_hardening"`
}

KubernetesSecurityConfig represents Kubernetes security configuration.

type KubesprayConfig

type KubesprayConfig struct {
	Version          string                  `yaml:"version" json:"version" validate:"required,semver"`
	Modules          map[string]ModuleConfig `yaml:"modules,omitempty" json:"modules,omitempty"`
	KubesprayCluster ModuleConfig            `yaml:"kubespray_cluster,omitempty" json:"kubespray_cluster,omitempty"`
}

KubesprayConfig represents Kubespray deployment configuration. Requirements: 5.2

type KubesprayDeployment

type KubesprayDeployment struct{}

KubesprayDeployment implements deployment validation for Kubespray. Requirements: 5.6

func (*KubesprayDeployment) GetMethodName

func (d *KubesprayDeployment) GetMethodName() string

GetMethodName returns the deployment method name.

func (*KubesprayDeployment) RequiresMasterNodes

func (d *KubesprayDeployment) RequiresMasterNodes() bool

RequiresMasterNodes returns whether this deployment method requires master nodes.

func (*KubesprayDeployment) ValidateCompatibility

func (d *KubesprayDeployment) ValidateCompatibility(provider string) error

ValidateCompatibility validates Kubespray compatibility with infrastructure provider.

func (*KubesprayDeployment) ValidateConfig

func (d *KubesprayDeployment) ValidateConfig(cfg *Config) error

ValidateConfig validates Kubespray deployment configuration.

type LocalBackendConfig

type LocalBackendConfig struct {
	Path string `yaml:"path" json:"path" validate:"required"`
}

LocalBackendConfig represents local backend configuration. Requirements: 20.2

type LokiSecrets

type LokiSecrets struct {
	SwiftPassword                    string `yaml:"swift_password,omitempty" json:"swift_password,omitempty"`
	SwiftApplicationCredentialSecret string `yaml:"swift_application_credential_secret,omitempty" json:"swift_application_credential_secret,omitempty"`
	S3AccessKeyID                    string `yaml:"s3_access_key_id,omitempty" json:"s3_access_key_id,omitempty"`
	S3SecretAccessKey                string `yaml:"s3_secret_access_key,omitempty" json:"s3_secret_access_key,omitempty"`
}

type MetaConfig

type MetaConfig struct {
	Name         string `yaml:"name" json:"name" validate:"required,dns1123"`
	Organization string `yaml:"organization" json:"organization" validate:"required"`
	Env          string `yaml:"env" json:"env" validate:"required,oneof=dev staging production"`
	Region       string `yaml:"region" json:"region" validate:"required"`
	Stage        string `yaml:"stage,omitempty" json:"stage,omitempty"`
	Status       string `yaml:"status,omitempty" json:"status,omitempty"`
	Locked       bool   `yaml:"locked,omitempty" json:"locked,omitempty"`
	LockReason   string `yaml:"lock_reason,omitempty" json:"lock_reason,omitempty"`
}

MetaConfig contains cluster identity and organizational context. Requirements: 1.3

type ModuleConfig

type ModuleConfig struct {
	Source  string         `yaml:"source,omitempty" json:"source,omitempty"`
	Enabled bool           `yaml:"enabled" json:"enabled"`
	Version string         `yaml:"version,omitempty" json:"version,omitempty"`
	Config  map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
}

ModuleConfig represents a deployment module configuration.

type NetworkPluginConfig

type NetworkPluginConfig struct {
	Calico  *CalicoConfig  `yaml:"calico,omitempty" json:"calico,omitempty"`
	Cilium  *CiliumConfig  `yaml:"cilium,omitempty" json:"cilium,omitempty"`
	KubeOVN *KubeOVNConfig `yaml:"kube-ovn,omitempty" json:"kube-ovn,omitempty"`
}

NetworkPluginConfig represents CNI plugin configuration. Requirements: 3.2

type NetworkSecurityConfig

type NetworkSecurityConfig struct {
	AllowedCIDRs []string `yaml:"allowed_cidrs,omitempty" json:"allowed_cidrs,omitempty" validate:"dive,cidrv4"`
	DenyAll      bool     `yaml:"deny_all" json:"deny_all"`
	OSHardening  bool     `yaml:"os_hardening" json:"os_hardening"`
}

NetworkSecurityConfig represents network security configuration.

type NetworkingConfig

type NetworkingConfig struct {
	// Network topology
	SubnetNodes         string `yaml:"subnet_nodes" json:"subnet_nodes" validate:"required,cidrv4"`
	AllocationPoolStart string `yaml:"allocation_pool_start" json:"allocation_pool_start" validate:"required,ipv4"`
	AllocationPoolEnd   string `yaml:"allocation_pool_end" json:"allocation_pool_end" validate:"required,ipv4"`
	Gateway             string `yaml:"gateway,omitempty" json:"gateway,omitempty" validate:"omitempty,ipv4"`

	// High availability
	VRRPIP      string `yaml:"vrrp_ip" json:"vrrp_ip" validate:"required_if=VRRPEnabled true,omitempty,ipv4"`
	VRRPEnabled bool   `yaml:"vrrp_enabled" json:"vrrp_enabled"`

	// Load balancing
	UseOctavia           bool   `yaml:"use_octavia,omitempty" json:"use_octavia,omitempty"`
	LoadbalancerProvider string `yaml:"loadbalancer_provider" json:"loadbalancer_provider" validate:"required,oneof=ovn octavia metallb cloud-native"`

	// DNS
	UseDesignate   bool     `yaml:"use_designate" json:"use_designate"`
	DNSZoneName    string   `yaml:"dns_zone_name" json:"dns_zone_name" validate:"required,fqdn"`
	DNSNameservers []string `yaml:"dns_nameservers" json:"dns_nameservers" validate:"required,min=1,dive,ipv4"`

	// Time synchronization
	NTPServers []string `yaml:"ntp_servers" json:"ntp_servers" validate:"required,min=1"`

	// Security
	Security NetworkSecurityConfig `yaml:"security,omitempty" json:"security,omitempty"`

	// VLAN
	VLAN VLANConfig `yaml:"vlan,omitempty" json:"vlan,omitempty"`
}

NetworkingConfig represents infrastructure networking configuration. Requirements: 2.1, 3.1, 3.2

type NodeNamingConfig

type NodeNamingConfig struct {
	Prefix string `yaml:"prefix,omitempty" json:"prefix,omitempty"`
	Suffix string `yaml:"suffix,omitempty" json:"suffix,omitempty"`
}

NodeNamingConfig represents node naming configuration.

type OIDCConfig

type OIDCConfig struct {
	Enabled                bool   `yaml:"enabled" json:"enabled"`
	IssuerURL              string `yaml:"issuer_url,omitempty" json:"issuer_url,omitempty" validate:"required_if=Enabled true,omitempty,url"`
	ClientID               string `yaml:"client_id,omitempty" json:"client_id,omitempty" validate:"required_if=Enabled true"`
	ClientSecret           string `yaml:"client_secret,omitempty" json:"client_secret,omitempty" validate:"required_if=Enabled true"`
	UsernameClaim          string `yaml:"username_claim,omitempty" json:"username_claim,omitempty"`
	GroupsClaim            string `yaml:"groups_claim,omitempty" json:"groups_claim,omitempty"`
	KubeOIDCURL            string `yaml:"kube_oidc_url,omitempty" json:"kube_oidc_url,omitempty"`
	KubeOIDCClientID       string `yaml:"kube_oidc_client_id,omitempty" json:"kube_oidc_client_id,omitempty"`
	KubeOIDCCAFile         string `yaml:"kube_oidc_ca_file,omitempty" json:"kube_oidc_ca_file,omitempty"`
	KubeOIDCUsernameClaim  string `yaml:"kube_oidc_username_claim,omitempty" json:"kube_oidc_username_claim,omitempty"`
	KubeOIDCUsernamePrefix string `yaml:"kube_oidc_username_prefix,omitempty" json:"kube_oidc_username_prefix,omitempty"`
	KubeOIDCGroupsClaim    string `yaml:"kube_oidc_groups_claim,omitempty" json:"kube_oidc_groups_claim,omitempty"`
	KubeOIDCGroupsPrefix   string `yaml:"kube_oidc_groups_prefix,omitempty" json:"kube_oidc_groups_prefix,omitempty"`
}

OIDCConfig represents OIDC authentication configuration.

type OpenCenterConfig

type OpenCenterConfig struct {
	Meta            MetaConfig           `yaml:"meta" json:"meta" validate:"required"`
	Cluster         ClusterConfig        `yaml:"cluster" json:"cluster" validate:"required"`
	Infrastructure  InfrastructureConfig `yaml:"infrastructure" json:"infrastructure" validate:"required"`
	Secrets         OpenCenterSecrets    `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	Identity        IdentityConfig       `yaml:"identity,omitempty" json:"identity,omitempty"`
	Services        ServiceMap           `yaml:"services,omitempty" json:"services,omitempty"`
	ManagedServices ServiceMap           `yaml:"managed_services,omitempty" json:"managed_services,omitempty"`
	LegacyManaged   ServiceMap           `yaml:"managed-service,omitempty" json:"managed-service,omitempty"`
	LegacyTalos     map[string]any       `yaml:"talos,omitempty" json:"-"`
	GitOps          GitOpsConfig         `yaml:"gitops,omitempty" json:"gitops,omitempty" validate:"required"`
}

OpenCenterConfig represents the main opencenter configuration with five domains. Requirements: 1.1, 1.3, 1.4, 1.5, 1.6, 1.7

type OpenCenterSecrets

type OpenCenterSecrets struct {
	Backend  string         `yaml:"backend,omitempty" json:"backend,omitempty"`
	Barbican BarbicanConfig `yaml:"barbican,omitempty" json:"barbican,omitempty"`
}

type OpenStackCloudConfig

type OpenStackCloudConfig struct {
	AuthURL                     string                     `yaml:"auth_url" json:"auth_url" validate:"required,url"`
	Region                      string                     `yaml:"region" json:"region" validate:"required"`
	ProjectID                   string                     `yaml:"project_id" json:"project_id" validate:"required"`
	ProjectName                 string                     `yaml:"project_name,omitempty" json:"project_name,omitempty"`
	ApplicationCredentialID     string                     `yaml:"application_credential_id,omitempty" json:"application_credential_id,omitempty"`
	ApplicationCredentialSecret string                     `yaml:"application_credential_secret,omitempty" json:"application_credential_secret,omitempty"`
	Insecure                    bool                       `yaml:"insecure,omitempty" json:"insecure,omitempty"`
	Domain                      string                     `yaml:"domain,omitempty" json:"domain,omitempty"`
	DomainName                  string                     `yaml:"domain_name,omitempty" json:"domain_name,omitempty"`
	TenantName                  string                     `yaml:"tenant_name,omitempty" json:"tenant_name,omitempty"`
	UserDomainName              string                     `yaml:"user_domain_name,omitempty" json:"user_domain_name,omitempty"`
	ProjectDomainName           string                     `yaml:"project_domain_name,omitempty" json:"project_domain_name,omitempty"`
	ImageID                     string                     `yaml:"image_id" json:"image_id" validate:"required"`
	ImageIDWindows              string                     `yaml:"image_id_windows,omitempty" json:"image_id_windows,omitempty"`
	ImageName                   string                     `yaml:"image_name,omitempty" json:"image_name,omitempty"`
	AvailabilityZone            string                     `yaml:"availability_zone,omitempty" json:"availability_zone,omitempty"`
	NetworkID                   string                     `yaml:"network_id" json:"network_id"`
	NetworkName                 string                     `yaml:"network_name,omitempty" json:"network_name,omitempty"`
	SubnetID                    string                     `yaml:"subnet_id" json:"subnet_id"`
	FloatingIPPool              string                     `yaml:"floating_ip_pool,omitempty" json:"floating_ip_pool,omitempty"`
	FloatingNetworkID           string                     `yaml:"floating_network_id,omitempty" json:"floating_network_id,omitempty"`
	ExternalNetworkName         string                     `yaml:"external_network_name,omitempty" json:"external_network_name,omitempty"`
	RouterExternalNetworkID     string                     `yaml:"router_external_network_id,omitempty" json:"router_external_network_id,omitempty"`
	DNSZoneName                 string                     `yaml:"dns_zone_name,omitempty" json:"dns_zone_name,omitempty"`
	AvailabilityZones           []string                   `yaml:"availability_zones,omitempty" json:"availability_zones,omitempty"`
	UseOctavia                  bool                       `yaml:"use_octavia" json:"use_octavia"`
	UseDesignate                bool                       `yaml:"use_designate" json:"use_designate"`
	CA                          string                     `yaml:"ca,omitempty" json:"ca,omitempty"`
	Networking                  *OpenStackNetworkingConfig `yaml:"networking,omitempty" json:"networking,omitempty"`
	Modules                     OpenStackModulesConfig     `yaml:"modules,omitempty" json:"modules,omitempty"`
}

OpenStackCloudConfig represents OpenStack-specific configuration. Requirements: 4.3

type OpenStackModulesConfig

type OpenStackModulesConfig struct {
	OpenstackNova OpenstackNovaModuleConfig `yaml:"openstack_nova,omitempty" json:"openstack_nova,omitempty"`
}

type OpenStackNetworkingConfig

type OpenStackNetworkingConfig struct {
	FloatingIPPool          string           `yaml:"floating_ip_pool,omitempty" json:"floating_ip_pool,omitempty"`
	FloatingNetworkID       string           `yaml:"floating_network_id,omitempty" json:"floating_network_id,omitempty"`
	NetworkID               string           `yaml:"network_id" json:"network_id"`
	RouterExternalNetworkID string           `yaml:"router_external_network_id,omitempty" json:"router_external_network_id,omitempty"`
	SubnetID                string           `yaml:"subnet_id" json:"subnet_id"`
	K8sAPIPortACL           []string         `yaml:"k8s_api_port_acl,omitempty" json:"k8s_api_port_acl,omitempty"`
	Designate               DesignateConfig  `yaml:"designate,omitempty" json:"designate,omitempty"`
	VLAN                    VLANConfigLegacy `yaml:"vlan,omitempty" json:"vlan,omitempty"`
}

type OpenStackProvider

type OpenStackProvider struct{}

OpenStackProvider implements provider validation for OpenStack. Requirements: 4.3

func (*OpenStackProvider) GetProviderName

func (p *OpenStackProvider) GetProviderName() string

GetProviderName returns the provider name.

func (*OpenStackProvider) ValidateConfig

func (p *OpenStackProvider) ValidateConfig(cfg *InfrastructureConfig) error

ValidateConfig validates OpenStack-specific configuration.

type OpenTofuConfig

type OpenTofuConfig struct {
	Enabled bool          `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Path    string        `yaml:"path,omitempty" json:"path,omitempty"`
	Backend BackendConfig `yaml:"backend,omitempty" json:"backend,omitempty" validate:"required"`
}

OpenTofuConfig represents OpenTofu/Terraform backend configuration. Requirements: 20.1

type OpenstackNovaModuleConfig

type OpenstackNovaModuleConfig struct {
	Source string `yaml:"source,omitempty" json:"source,omitempty"`
}

type Provider

type Provider interface {
	ValidateConfig(cfg *InfrastructureConfig) error
	GetProviderName() string
}

Provider interface defines provider-specific validation. Requirements: 4.3, 4.4, 4.5, 4.6, 4.8

func GetProvider

func GetProvider(providerName string) (Provider, error)

GetProvider returns the appropriate provider validator for the given provider name.

type ReadinessReport

type ReadinessReport struct {
	Valid  bool              `json:"valid"`
	Issues []ValidationIssue `json:"issues,omitempty"`
}

ReadinessReport contains deterministic, offline deployment-readiness findings.

func ValidateReadiness

func ValidateReadiness(cfg *Config) ReadinessReport

ValidateReadiness validates cross-field deployment-readiness rules that are not covered by schema tags. It does not contact cloud providers or Git remotes.

type ReferenceResolver

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

ReferenceResolver resolves ${ref:path.to.value}, ${env:VAR}, and ${file:path} references in v2 configuration structures. Requirements: 4.2 (Epic 4: Medium Priority TODO Resolution)

func NewReferenceResolver

func NewReferenceResolver() *ReferenceResolver

NewReferenceResolver creates a new reference resolver with caching support.

func (*ReferenceResolver) Resolve

func (r *ReferenceResolver) Resolve(cfg interface{}) error

Resolve resolves all references in the configuration using reflection. It works with any struct type, making it compatible with v2.Config. Requirements: 4.2.2

type S3BackendConfig

type S3BackendConfig struct {
	Bucket string `yaml:"bucket" json:"bucket" validate:"required"`
	Key    string `yaml:"key" json:"key" validate:"required"`
	Region string `yaml:"region" json:"region" validate:"required"`
}

S3BackendConfig represents S3 backend configuration. Requirements: 20.3

type SOPSConfig

type SOPSConfig struct {
	Enabled        bool   `yaml:"enabled" json:"enabled"`
	AgeKeyFile     string `yaml:"age_key_file,omitempty" json:"age_key_file,omitempty" validate:"required_if=Enabled true"`
	EncryptedRegex string `yaml:"encrypted_regex,omitempty" json:"encrypted_regex,omitempty"`
}

SOPSConfig represents SOPS encryption configuration. Requirements: 18.5, 18.6

type SSHConfig

type SSHConfig struct {
	AuthorizedKeys []string `yaml:"authorized_keys" json:"authorized_keys" validate:"required,min=1"`
	Username       string   `yaml:"username,omitempty" json:"username,omitempty"`
	User           string   `yaml:"user,omitempty" json:"user,omitempty"`
	KeyPath        string   `yaml:"key_path,omitempty" json:"key_path,omitempty"`
}

SSHConfig represents SSH configuration for cluster nodes.

type SSHKeyConfig

type SSHKeyConfig struct {
	Private string `yaml:"private,omitempty" json:"private,omitempty"`
	Public  string `yaml:"public,omitempty" json:"public,omitempty"`
	Cypher  string `yaml:"cypher,omitempty" json:"cypher,omitempty"`
}

type SecretsConfig

type SecretsConfig struct {
	SopsAgeKeyFile string             `yaml:"sops_age_key_file,omitempty" json:"sops_age_key_file,omitempty"`
	SSHKey         SSHKeyConfig       `yaml:"ssh_key,omitempty" json:"ssh_key,omitempty"`
	Global         GlobalSecrets      `yaml:"global,omitempty" json:"global,omitempty"`
	CertManager    CertManagerSecrets `yaml:"cert_manager,omitempty" json:"cert_manager,omitempty"`
	Loki           LokiSecrets        `yaml:"loki,omitempty" json:"loki,omitempty"`
	Keycloak       KeycloakSecrets    `yaml:"keycloak,omitempty" json:"keycloak,omitempty"`
	Headlamp       HeadlampSecrets    `yaml:"headlamp,omitempty" json:"headlamp,omitempty"`
	WeaveGitOps    WeaveGitOpsSecrets `yaml:"weave_gitops,omitempty" json:"weave_gitops,omitempty"`
	Grafana        GrafanaSecrets     `yaml:"grafana,omitempty" json:"grafana,omitempty"`
	Tempo          TempoSecrets       `yaml:"tempo,omitempty" json:"tempo,omitempty"`
	AlertProxy     AlertProxySecrets  `yaml:"alert_proxy,omitempty" json:"alert_proxy,omitempty"`
	VSphereCsi     VSphereCsiSecrets  `yaml:"vsphere_csi,omitempty" json:"vsphere_csi,omitempty"`
	ServiceSecrets map[string]any     `yaml:"service_secrets,omitempty" json:"service_secrets,omitempty"`
	SOPSConfig     SOPSConfig         `yaml:"sops,omitempty" json:"sops,omitempty"`
	OverlayUnits   overlaycfg.Secrets `yaml:"overlay_units,omitempty" json:"overlay_units,omitempty"`
}

SecretsConfig represents secrets configuration. Requirements: 18.1, 18.2, 18.3

type ServiceMap

type ServiceMap map[string]any

ServiceMap is a polymorphic map of service configurations. Requirements: 17.1, 17.2, 17.7

Stability: the overlay unit types referenced by GitOpsConfig.OverlayUnits and SecretsConfig.OverlayUnits (defined in internal/config/overlay/types.go) are considered stable as of schema_version 2.0. Changes to those types require a schema version bump. ServiceMap itself remains map[string]any with custom YAML unmarshaling via the service registry; typed service configs are resolved at unmarshal time through registered service types.

func (ServiceMap) MarshalYAML

func (sm ServiceMap) MarshalYAML() (interface{}, error)

MarshalYAML implements custom YAML marshaling for ServiceMap.

func (*ServiceMap) UnmarshalYAML

func (sm *ServiceMap) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshaling for ServiceMap. It uses the service registry to determine the correct type for each service.

type StaticNode

type StaticNode struct {
	ID         string `yaml:"id,omitempty" json:"id,omitempty"`
	Name       string `yaml:"name" json:"name"`
	AccessIPv4 string `yaml:"access_ip_v4" json:"access_ip_v4"`
}

StaticNode represents a pre-provisioned node for baremetal/vmware deployments.

type StorageConfig

type StorageConfig struct {
	DefaultStorageClass             string              `yaml:"default_storage_class" json:"default_storage_class" validate:"required"`
	WorkerVolumeSize                int                 `yaml:"worker_volume_size" json:"worker_volume_size" validate:"required,min=1"`
	WorkerVolumeDestinationType     string              `yaml:"worker_volume_destination_type" json:"worker_volume_destination_type" validate:"required,oneof=volume local"`
	WorkerVolumeSourceType          string              `yaml:"worker_volume_source_type" json:"worker_volume_source_type" validate:"required,oneof=image volume snapshot"`
	WorkerVolumeType                string              `yaml:"worker_volume_type" json:"worker_volume_type" validate:"required"`
	WorkerVolumeDeleteOnTermination bool                `yaml:"worker_volume_delete_on_termination" json:"worker_volume_delete_on_termination"`
	MasterVolumeSize                int                 `yaml:"master_volume_size" json:"master_volume_size" validate:"min=0"`
	MasterVolumeDestinationType     string              `yaml:"master_volume_destination_type,omitempty" json:"master_volume_destination_type,omitempty"`
	MasterVolumeSourceType          string              `yaml:"master_volume_source_type,omitempty" json:"master_volume_source_type,omitempty"`
	MasterVolumeType                string              `yaml:"master_volume_type,omitempty" json:"master_volume_type,omitempty"`
	MasterVolumeDeleteOnTermination bool                `yaml:"master_volume_delete_on_termination" json:"master_volume_delete_on_termination"`
	AdditionalBlockDevices          []BlockDeviceConfig `yaml:"additional_block_devices,omitempty" json:"additional_block_devices,omitempty"`
}

StorageConfig represents storage configuration. Requirements: 9.2

type StoragePluginConfig

type StoragePluginConfig struct {
	VSphereCsi    *VSphereCsiConfig    `yaml:"vsphere_csi,omitempty" json:"vsphere_csi,omitempty"`
	CinderCsi     *CinderCsiConfig     `yaml:"cinder_csi,omitempty" json:"cinder_csi,omitempty"`
	AwsEbsCsi     *AwsEbsCsiConfig     `yaml:"aws_ebs_csi,omitempty" json:"aws_ebs_csi,omitempty"`
	GcpComputeCsi *GcpComputeCsiConfig `yaml:"gcp_compute_csi,omitempty" json:"gcp_compute_csi,omitempty"`
	AzureDiskCsi  *AzureDiskCsiConfig  `yaml:"azure_disk_csi,omitempty" json:"azure_disk_csi,omitempty"`
	Ceph          *CephCsiConfig       `yaml:"ceph,omitempty" json:"ceph,omitempty"`
	Trident       *TridentCsiConfig    `yaml:"trident,omitempty" json:"trident,omitempty"`
}

StoragePluginConfig represents CSI plugin configuration. Requirements: 9.3, 9.4

type TaintConfig

type TaintConfig struct {
	Key    string `yaml:"key" json:"key" validate:"required"`
	Value  string `yaml:"value,omitempty" json:"value,omitempty"`
	Effect string `yaml:"effect" json:"effect" validate:"required,oneof=NoSchedule PreferNoSchedule NoExecute"`
}

TaintConfig represents Kubernetes node taint configuration.

type TempoSecrets

type TempoSecrets struct {
	AccessKey                        string `yaml:"access_key,omitempty" json:"access_key,omitempty"`
	SecretKey                        string `yaml:"secret_key,omitempty" json:"secret_key,omitempty"`
	SwiftApplicationCredentialSecret string `yaml:"swift_application_credential_secret,omitempty" json:"swift_application_credential_secret,omitempty"`
}

type TridentCsiConfig

type TridentCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

TridentCsiConfig represents NetApp Trident CSI driver configuration.

type VLANConfig

type VLANConfig struct {
	Enabled bool `yaml:"enabled" json:"enabled"`
	ID      int  `yaml:"id,omitempty" json:"id,omitempty" validate:"omitempty,min=1,max=4094"`
}

VLANConfig represents VLAN configuration.

type VLANConfigLegacy

type VLANConfigLegacy struct {
	ID       string `yaml:"id,omitempty" json:"id,omitempty"`
	MTU      int    `yaml:"mtu,omitempty" json:"mtu,omitempty"`
	Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
}

type VMwareCloudConfig

type VMwareCloudConfig struct {
	VCenterServer string `yaml:"vcenter_server" json:"vcenter_server" validate:"required,hostname|ip"`
	Datacenter    string `yaml:"datacenter" json:"datacenter" validate:"required"`
	Cluster       string `yaml:"cluster,omitempty" json:"cluster,omitempty"`
	Datastore     string `yaml:"datastore" json:"datastore" validate:"required"`
	Network       string `yaml:"network" json:"network" validate:"required"`
	Template      string `yaml:"template" json:"template" validate:"required"`
	Folder        string `yaml:"folder,omitempty" json:"folder,omitempty"`
}

VMwareCloudConfig represents VMware-specific configuration.

type VMwareProvider

type VMwareProvider struct{}

VMwareProvider implements provider validation for VMware/vSphere.

func (*VMwareProvider) GetProviderName

func (p *VMwareProvider) GetProviderName() string

GetProviderName returns the provider name.

func (*VMwareProvider) ValidateConfig

func (p *VMwareProvider) ValidateConfig(cfg *InfrastructureConfig) error

ValidateConfig validates VMware-specific configuration.

type VSphereCsiConfig

type VSphereCsiConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
}

VSphereCsiConfig represents vSphere CSI driver configuration.

type VSphereCsiSecrets

type VSphereCsiSecrets struct {
	VCenterHost  string `yaml:"vcenter_host,omitempty" json:"vcenter_host,omitempty"`
	Username     string `yaml:"username,omitempty" json:"username,omitempty"`
	Password     string `yaml:"password,omitempty" json:"password,omitempty"`
	Datacenters  string `yaml:"datacenters,omitempty" json:"datacenters,omitempty"`
	InsecureFlag string `yaml:"insecure_flag,omitempty" json:"insecure_flag,omitempty"`
	Port         string `yaml:"port,omitempty" json:"port,omitempty"`
	Datastoreurl string `yaml:"datastoreurl,omitempty" json:"datastoreurl,omitempty"`
}

type ValidationCategory

type ValidationCategory string

ValidationCategory groups readiness issues by validation subsystem.

const (
	CategorySchema       ValidationCategory = "schema"
	CategoryProvider     ValidationCategory = "provider"
	CategoryGitOps       ValidationCategory = "gitops"
	CategoryServices     ValidationCategory = "services"
	CategoryConnectivity ValidationCategory = "connectivity"
)

type ValidationIssue

type ValidationIssue struct {
	Severity   ValidationSeverity `json:"severity"`
	Category   ValidationCategory `json:"category"`
	Path       string             `json:"path,omitempty"`
	Message    string             `json:"message"`
	Suggestion string             `json:"suggestion,omitempty"`
}

ValidationIssue is a structured validation finding.

type ValidationSeverity

type ValidationSeverity string

ValidationSeverity identifies whether a readiness issue blocks deployment.

const (
	SeverityError   ValidationSeverity = "error"
	SeverityWarning ValidationSeverity = "warning"
)

type Validator

type Validator interface {
	Validate(cfg *Config) error
	ValidateSchema(cfg *Config) error
	ValidateBusinessRules(cfg *Config) error
	ValidateProvider(cfg *Config) error
	ValidateDeployment(cfg *Config) error
	ValidateServices(cfg *Config) error
}

Validator performs multi-layered validation of v2 configurations. Requirements: 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7

func NewValidator

func NewValidator() Validator

NewValidator creates a new v2 configuration validator.

type VolumeConfig

type VolumeConfig struct {
	Size                int    `yaml:"size" json:"size" validate:"required,min=1"`
	Type                string `yaml:"type,omitempty" json:"type,omitempty"`
	DestinationType     string `yaml:"destination_type,omitempty" json:"destination_type,omitempty" validate:"omitempty,oneof=volume local"`
	SourceType          string `yaml:"source_type,omitempty" json:"source_type,omitempty" validate:"omitempty,oneof=image volume snapshot"`
	DeleteOnTermination bool   `yaml:"delete_on_termination" json:"delete_on_termination"`
}

VolumeConfig represents volume configuration.

type WeaveGitOpsSecrets

type WeaveGitOpsSecrets struct {
	Password     string `yaml:"password,omitempty" json:"password,omitempty"`
	PasswordHash string `yaml:"password_hash,omitempty" json:"password_hash,omitempty"`
}

type WorkerPoolConfig

type WorkerPoolConfig struct {
	Name              string            `yaml:"name" json:"name" validate:"required,dns1123"`
	Count             int               `yaml:"count" json:"count" validate:"required,min=1"`
	Flavor            string            `yaml:"flavor" json:"flavor" validate:"required"`
	Image             string            `yaml:"image,omitempty" json:"image,omitempty"`
	BootVolume        VolumeConfig      `yaml:"boot_volume,omitempty" json:"boot_volume,omitempty"`
	AdditionalVolumes []VolumeConfig    `yaml:"additional_volumes,omitempty" json:"additional_volumes,omitempty"`
	Labels            map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	Taints            []TaintConfig     `yaml:"taints,omitempty" json:"taints,omitempty"`
}

WorkerPoolConfig represents additional worker pool configuration. Requirements: 9.5

type YAMLTypeErrors

type YAMLTypeErrors struct {
	Errors []string
}

YAMLTypeErrors wraps individual YAML type errors so they can be split into separate validation messages by the formatter.

func (*YAMLTypeErrors) Error

func (e *YAMLTypeErrors) Error() string

Jump to

Keyboard shortcuts

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