Documentation
¶
Overview ¶
Package klioconfig provides shared configuration logic for building and managing Klio config data across the operator and reconcilers.
Index ¶
- Constants
- func GenerateConfig(spec kliov1alpha1.PluginConfigurationSpec, configKey string) *config.Data
- func GetClientSecretVolumeMountPath(hostName string) string
- func GetServerSecretVolumeMountPath(hostName string) string
- func IsPluginConfigurationNotFound(err error) bool
- type ClusterPlugins
- type PluginConfigurationNotFoundError
Constants ¶
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" )
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" )
const ConfigDataKey = "config.yaml"
ConfigDataKey is the key used for the config data in klio-config secrets.
const TypeLabelKey = "klio.cnpg.io/type"
TypeLabelKey is the label key used to identify klio-config secrets.
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 ¶
GetClientSecretVolumeMountPath returns the volume mount path for client secrets.
func GetServerSecretVolumeMountPath ¶
GetServerSecretVolumeMountPath returns the volume mount path for server secrets.
func IsPluginConfigurationNotFound ¶
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 ¶
func (e *PluginConfigurationNotFoundError) Error() string