config

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnableCache = os.Getenv("DISABLE_CACHE") != "true"

EnableCache controls whether caching is enabled globally Cache is enabled by default for production performance This affects both web cache headers and AzureOAuthProvider cache Can be disabled via DISABLE_CACHE environment variable

Functions

This section is empty.

Types

type ConfigData

type ConfigData struct {
	// Command execution timeout in seconds
	Timeout int
	// Cache timeout for Azure resources
	CacheTimeout time.Duration
	// Security configuration
	SecurityConfig *security.SecurityConfig
	// OAuth configuration
	OAuthConfig *auth.OAuthConfig

	// Command-line specific options
	Transport   string
	Host        string
	Port        int
	AccessLevel string

	// Kubernetes-specific options
	// List of enabled components (empty means all components enabled)
	EnabledComponents []string
	// Comma-separated list of allowed Kubernetes namespaces
	AllowNamespaces string

	// Log level (debug, info, warn, error)
	LogLevel string

	// OTLP endpoint for OpenTelemetry traces
	OTLPEndpoint string

	// Telemetry service
	TelemetryService *telemetry.Service

	// UseLegacyTools controls whether to use legacy tools or new unified tools
	// Azure tools: true = az_aks_operations/az_compute_operations, false = call_az
	// Kubectl tools: true = specialized tools (kubectl_resources, kubectl_workloads, etc.), false = call_kubectl
	// Default is false (use new unified tools)
	// This flag is provided for backward compatibility and may be removed in future versions
	UseLegacyTools bool

	// TokenAuthOnly enables token-only authentication mode for tools that support it
	// When enabled, supported tools (e.g., kubectl) are executed via Azure AKS RunCommand API using user-provided tokens
	// When disabled (default), tools are executed locally with default authentication (e.g., kubeconfig for Kubernetes tools)
	TokenAuthOnly bool
}

ConfigData holds the global configuration

func NewConfig

func NewConfig() *ConfigData

NewConfig creates and returns a new configuration instance

func (*ConfigData) InitializeTelemetry added in v0.0.6

func (cfg *ConfigData) InitializeTelemetry(ctx context.Context, serviceName, serviceVersion string)

InitializeTelemetry initializes the telemetry service

func (*ConfigData) ParseFlags

func (cfg *ConfigData) ParseFlags()

ParseFlags parses command line arguments and updates the configuration

func (*ConfigData) PrintVersion added in v0.0.7

func (cfg *ConfigData) PrintVersion()

PrintVersion prints version information

func (*ConfigData) ValidateConfig added in v0.0.8

func (cfg *ConfigData) ValidateConfig() error

ValidateConfig validates the configuration for incompatible settings

type Validator

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

Validator handles all validation logic for AKS MCP

func NewValidator

func NewValidator(cfg *ConfigData) *Validator

NewValidator creates a new validator instance

func (*Validator) GetErrors

func (v *Validator) GetErrors() []string

GetErrors returns all errors found during validation

func (*Validator) PrintErrors

func (v *Validator) PrintErrors()

PrintErrors prints all validation errors to stdout

func (*Validator) Validate

func (v *Validator) Validate() bool

Validate runs all validation checks

Jump to

Keyboard shortcuts

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