config

package
v0.0.320 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CleanupInterval               time.Duration      `mapstructure:"cleanupInterval"`
	DefaultNamespace              string             `mapstructure:"defaultNamespace"`
	HostType                      armotypes.HostType `mapstructure:"hostType"`
	DisableVirtualCRDs            bool               `mapstructure:"disableVirtualCRDs"`
	DisableSeccompProfileEndpoint bool               `mapstructure:"disableSeccompProfileEndpoint"`
	ExcludeJsonPaths              []string           `mapstructure:"excludeJsonPaths"`
	MaxContainerProfileSize       int                `mapstructure:"maxContainerProfileSize"`
	MaxSniffingTime               time.Duration      `mapstructure:"maxSniffingTimePerContainer"`
	RateLimitPerClient            float64            `mapstructure:"rateLimitPerClient"`
	RateLimitTotal                int                `mapstructure:"rateLimitTotal"`
	ServerBindAddress             string             `mapstructure:"serverBindAddress"`
	ServerBindPort                int                `mapstructure:"serverBindPort"`
	TlsClientCaFile               string             `mapstructure:"tlsClientCaFile"`
	TlsServerCertFile             string             `mapstructure:"tlsServerCertFile"`
	TlsServerKeyFile              string             `mapstructure:"tlsServerKeyFile"`

	// SqlitePoolSize is the capacity of the SQLite connection pool. Defaults
	// to file.DefaultPoolSize (10) when unset. This is a cheap, reversible
	// tuning knob for Phase 0 of the storage-locking investigation (see
	// docs/features/storage-lock-pool-metrics.md) — it does not change any
	// lock/connection acquisition ordering.
	SqlitePoolSize int `mapstructure:"sqlitePoolSize"`
	// SqliteBusyTimeout is the busy-timeout applied to every pooled SQLite
	// connection. Defaults to file.DefaultBusyTimeout (60s) when unset.
	SqliteBusyTimeout time.Duration `mapstructure:"sqliteBusyTimeout"`
	// PoolTimeout bounds how long a caller blocks in pool.Take() waiting for a free
	// connection from the SQLite connection pool, before failing fast with a
	// ServerTimeout+Retry-After signal. Defaults to file.DefaultPoolTimeout (5s) when
	// unset. This is distinct from SqliteBusyTimeout, which governs SQLite's own
	// internal busy-handler on a single already-acquired connection. See
	// docs/features/storage-lock-pool-metrics.md.
	PoolTimeout time.Duration `mapstructure:"poolTimeout"`

	// SingleWriterEnabled gates the single-dedicated-writer + priority-queue
	// write path prototyped on spike/single-writer-priority-queue (see
	// pkg/registry/file/singlewriter.go). Defaults to false: when unset,
	// Create/GuaranteedUpdate/SaveContainerProfile behave exactly as they did
	// before that path existed. This is a spike/prototype flag, not yet
	// validated for production use.
	SingleWriterEnabled bool `mapstructure:"singleWriterEnabled"`

	// CustomKnownServersRestEnabled gates the hand-written rest.Storage
	// implementation for the knownservers resource (see
	// pkg/registry/softwarecomposition/knownservers/custom_rest.go), built as
	// Phase 4's first per-resource migration off genericregistry.Store (see
	// docs/features/generic-rest-storage-phase4.md). Defaults to false: when unset,
	// pkg/apiserver/apiserver.go registers knownservers via the OLD
	// genericregistry.Store-based knownservers.NewREST, exactly as before
	// this flag existed. The old implementation is kept alive as the
	// reference implementation for differential testing regardless of this
	// flag's value.
	CustomKnownServersRestEnabled bool `mapstructure:"customKnownServersRestEnabled"`

	// CustomOpenVulnerabilityExchangeRestEnabled gates the hand-written
	// rest.Storage implementation for the openvulnerabilityexchangecontainers
	// resource (see
	// pkg/registry/softwarecomposition/openvulnerabilityexchange/custom_rest.go),
	// built as Phase 4's second per-resource migration off
	// genericregistry.Store (see docs/features/generic-rest-storage-phase4.md).
	// Defaults to false: when unset, pkg/apiserver/apiserver.go registers
	// openvulnerabilityexchangecontainers via the OLD
	// genericregistry.Store-based openvulnerabilityexchange.NewREST, exactly
	// as before this flag existed. The old implementation is kept alive as
	// the reference implementation for differential testing regardless of
	// this flag's value.
	CustomOpenVulnerabilityExchangeRestEnabled bool `mapstructure:"customOpenVulnerabilityExchangeRestEnabled"`

	// CustomContainerProfileRestEnabled gates the hand-written rest.Storage
	// implementation for the containerprofiles resource (see
	// pkg/registry/softwarecomposition/containerprofile/custom_rest.go),
	// built as Phase 4's third per-resource migration off
	// genericregistry.Store (see docs/features/generic-rest-storage-phase4.md).
	// Defaults to false: when unset, pkg/apiserver/apiserver.go registers
	// containerprofiles via the OLD genericregistry.Store-based
	// containerprofile.NewREST, exactly as before this flag existed. The old
	// implementation is kept alive as the reference implementation for
	// differential testing regardless of this flag's value.
	CustomContainerProfileRestEnabled bool `mapstructure:"customContainerProfileRestEnabled"`

	// The following gate the remaining Phase 4 per-resource rest.Storage
	// migrations off genericregistry.Store (see
	// docs/features/generic-rest-storage-phase4.md), following the same pattern as
	// CustomContainerProfileRestEnabled above: each defaults to false, and
	// the OLD genericregistry.Store-based NewREST for that resource remains
	// the default and the differential-testing reference regardless of the
	// flag's value.
	CustomCollapseConfigurationRestEnabled            bool `mapstructure:"customCollapseConfigurationRestEnabled"`
	CustomSBOMSyftFilteredRestEnabled                 bool `mapstructure:"customSBOMSyftFilteredRestEnabled"`
	CustomSBOMSyftRestEnabled                         bool `mapstructure:"customSBOMSyftRestEnabled"`
	CustomSeccompProfileRestEnabled                   bool `mapstructure:"customSeccompProfileRestEnabled"`
	CustomVulnerabilityManifestRestEnabled            bool `mapstructure:"customVulnerabilityManifestRestEnabled"`
	CustomVulnerabilityManifestSummaryRestEnabled     bool `mapstructure:"customVulnerabilityManifestSummaryRestEnabled"`
	CustomWorkloadConfigurationScanRestEnabled        bool `mapstructure:"customWorkloadConfigurationScanRestEnabled"`
	CustomWorkloadConfigurationScanSummaryRestEnabled bool `mapstructure:"customWorkloadConfigurationScanSummaryRestEnabled"`

	// New fields for per-kind queue/worker/object size config
	KindQueues           map[string]KindQueueConfig `mapstructure:"kindQueues"`
	DefaultQueueLength   int                        `mapstructure:"defaultQueueLength"`
	DefaultWorkerCount   int                        `mapstructure:"defaultWorkerCount"`
	DefaultMaxObjectSize int                        `mapstructure:"defaultMaxObjectSize"`

	// Debugging
	QueueManagerEnabled       bool `mapstructure:"queueManagerEnabled"`
	QueueTimeoutPrint         bool `mapstructure:"queueTimeoutPrint"`
	QueueTimeout              int  `mapstructure:"queueTimeout"`
	QueueProcessingStatsPrint bool `mapstructure:"queueProcessingStatsPrint"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads configuration from file or environment variables.

type KindQueueConfig added in v0.0.199

type KindQueueConfig struct {
	QueueLength   int `mapstructure:"queueLength"`
	WorkerCount   int `mapstructure:"workerCount"`
	MaxObjectSize int `mapstructure:"maxObjectSize"`
}

Jump to

Keyboard shortcuts

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