utils

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClusterConfigNotFound is the sentinel error returned by
	// GetClusterConfig if the cluster configuration is not found.
	ErrClusterConfigNotFound = errors.New("not found")
)

Functions

func EnforceClusterConfig added in v1.16.0

func EnforceClusterConfig(
	ctx context.Context, clusterName string, config cmtypes.CiliumClusterConfig,
	backend ClusterConfigBackend, log logrus.FieldLogger,
) (stopAndWait func(), err error)

EnforceClusterConfig 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 GetClusterConfig

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

func SetClusterConfig

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

Types

type ClusterConfigBackend added in v1.16.0

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

Jump to

Keyboard shortcuts

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