clustercfg

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is the sentinel error returned by [clustercfg.Get] if the
	// cluster configuration is not found.
	ErrNotFound = errors.New("not found")
)

Functions

func Enforce

func Enforce(
	ctx context.Context, clusterName string, config cmtypes.CiliumClusterConfig,
	backend ClusterConfigBackend, log *slog.Logger,
) (stopAndWait func(), err error)

Enforce synchronously writes the cluster configuration, and additionally registers a background task to periodically enforce its presence (e.g., in case the associated lease unexpectedly expired).

func Get

func RegisterEnforcer

func RegisterEnforcer(in struct {
	cell.In

	JobGroup job.Group

	ClusterInfo   cmtypes.ClusterInfo
	ClusterConfig cmtypes.CiliumClusterConfig

	Client       kvstore.Client
	StoreFactory store.Factory
}) error

RegisterEnforcer sets up the logic to write the cluster configuration to the kvstore, and automatically revert possible external modifications.

func Set

func Set(ctx context.Context, clusterName string, config cmtypes.CiliumClusterConfig, backend ClusterConfigBackend) error

Types

type ClusterConfigBackend

type ClusterConfigBackend interface {
	Get(ctx context.Context, key string) ([]byte, error)
	UpdateIfDifferent(ctx context.Context, key string, value []byte, lease bool) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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