resolver

package
v1.17.0-pre.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package resolver provides the logic for merging in the various sources of configuration, overrides, and drop-ins.

Index

Constants

View Source
const (
	KindConfigMap  = "config-map"
	KindNode       = "node"
	KindNodeConfig = "cilium-node-config"

	ConfigSources          = "config-sources"
	ConfigSourcesOverrides = "config-sources-overrides"
)

Variables

This section is empty.

Functions

func ResolveConfigurations

func ResolveConfigurations(ctx context.Context, client client.Clientset, nodeName string, sources []ConfigSource, allowConfigKeys, denyConfigKeys []string) (map[string]string, error)

func WriteConfigurations

func WriteConfigurations(ctx context.Context, destDir string, data map[string]string) error

WriteConfigurations writes the key-value pairs in data to destDir. It writes it like a Kubernetes config-map: It uses a double-layer symlink to allow for atomic updates: destDir/key -> ..data/key ..data -> ..data_$time

Types

type ConfigOverride

type ConfigOverride struct {
	AllowConfigKeys []string `json:"allowConfigKeys"` // List of configuration keys that are allowed to be overridden (e.g. set from not the first source. Takes precedence over deny-config-keys
	DenyConfigKeys  []string `json:"denyConfigKeys"`  // List of configuration keys that are not allowed to be overridden (e.g. set from not the first source. If allow-config-keys is set, this field is ignored"
}

type ConfigSource

type ConfigSource struct {
	Kind      string `json:"kind"`      // one of KindConfigMap, KindNodeConfig, KindNode
	Namespace string `json:"namespace"` // The namespace for the ConfigMap, CiliumNodeConfigs or empty for Node
	Name      string `json:"name"`      // The name of the ConfigMap or Node, unused for Overrides
}

func ReadConfigSource

func ReadConfigSource(ctx context.Context, client client.Clientset, nodeName string, source ConfigSource) (config map[string]string, sources []ConfigSource, err error)

func (*ConfigSource) String

func (cs *ConfigSource) String() string

Jump to

Keyboard shortcuts

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