klioconfig

package
v0.0.0-...-de9510f Latest Latest
Warning

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

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

Documentation

Overview

Package klioconfig provides shared configuration logic for building and managing Klio config data across the operator and reconcilers.

Index

Constants

View Source
const (
	// PluginName is the name of the Klio plugin.
	PluginName = "klio.cnpg.io"

	// ArchiveConfigKey is the key used for the archive plugin configuration.
	ArchiveConfigKey = "klio-archive"

	// PluginConfigurationRefParam is the name of the parameter that contains
	// the reference to the Klio PluginConfiguration resource.
	PluginConfigurationRefParam = "pluginConfigurationRef"
)
View Source
const (
	// KlioTier1HTTPPort is the default port for Klio Tier1 HTTP API.
	KlioTier1HTTPPort = "51515"
	// KlioTier2HTTPPort is the default port for Klio Tier2 HTTP API.
	KlioTier2HTTPPort = "51516"
	// KlioTier1GRPCPort is the default port for Klio Tier1 gRPC API.
	KlioTier1GRPCPort = "52000"
	// KlioTier2GRPCPort is the default port for Klio Tier2 gRPC API.
	KlioTier2GRPCPort = "52001"
)
View Source
const ConfigDataKey = "config.yaml"

ConfigDataKey is the key used for the config data in klio-config secrets.

View Source
const TypeLabelKey = "klio.cnpg.io/type"

TypeLabelKey is the label key used to identify klio-config secrets.

View Source
const TypeLabelValue = "klio-config"

TypeLabelValue is the label value used to identify klio-config secrets.

Variables

This section is empty.

Functions

func GenerateConfig

func GenerateConfig(
	spec kliov1alpha1.PluginConfigurationSpec,
	configKey string,
) *config.Data

GenerateConfig builds a config.Data from a PluginConfigurationSpec. configKey is the configuration key (e.g. "klio-archive").

func GetClientSecretVolumeMountPath

func GetClientSecretVolumeMountPath(hostName string) string

GetClientSecretVolumeMountPath returns the volume mount path for client secrets.

func GetServerSecretVolumeMountPath

func GetServerSecretVolumeMountPath(hostName string) string

GetServerSecretVolumeMountPath returns the volume mount path for server secrets.

func IsPluginConfigurationNotFound

func IsPluginConfigurationNotFound(err error) bool

IsPluginConfigurationNotFound checks if the error indicates a missing PluginConfiguration.

Types

type ClusterPlugins

type ClusterPlugins map[string]*kliov1alpha1.PluginConfiguration

ClusterPlugins maps config keys to their resolved PluginConfiguration. All entries are validated and filtered — only enabled Klio plugins with a valid PluginConfiguration are included.

func ResolveClusterPlugins

func ResolveClusterPlugins(
	ctx context.Context,
	cli client.Client,
	cluster *cnpgv1.Cluster,
) (ClusterPlugins, error)

ResolveClusterPlugins resolves all plugin configurations for a cluster, filtering out disabled or invalid entries, and returns the fully resolved plugin data ready for downstream consumption.

func (ClusterPlugins) ArchivePluginConfiguration

func (cp ClusterPlugins) ArchivePluginConfiguration() *kliov1alpha1.PluginConfiguration

ArchivePluginConfiguration returns the PluginConfiguration for the archive key, or nil.

type PluginConfigurationNotFoundError

type PluginConfigurationNotFoundError struct {
	Name string
}

PluginConfigurationNotFoundError is returned when a PluginConfiguration does not exist.

func (*PluginConfigurationNotFoundError) Error

Jump to

Keyboard shortcuts

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