directory

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"policy-directory-watcher",
	"Watches Directory for cilium network policy file updates",
	cell.Config(defaultConfig),
	cell.Provide(newDirectoryPolicyResourcesWatcher,
		func() DirectoryWatcherReadStatus {
			return make(DirectoryWatcherReadStatus)
		}),
)

Cell provides the Directory policy watcher. The Directory policy watcher watches CiliumNetworkPolicy, CiliumClusterWideNetworkPolicy created/deleted under a directory specified through cilium config. It reads and translates them to Cilium's own policy representation (api.Rules) and updates the policy repository (via PolicyManager) accordingly.

Functions

This section is empty.

Types

type Config

type Config struct {
	StaticCNPPath string
}

func (Config) Flags

func (cfg Config) Flags(flags *pflag.FlagSet)

type DirectoryWatcherReadStatus

type DirectoryWatcherReadStatus chan struct{}

type PolicyManager

type PolicyManager interface {
	PolicyAdd(rules api.Rules, opts *policy.AddOptions) (newRev uint64, err error)
	PolicyDelete(labels labels.LabelArray, opts *policy.DeleteOptions) (newRev uint64, err error)
}

type PolicyResourcesWatcher

type PolicyResourcesWatcher struct {
	// contains filtered or unexported fields
}

func (*PolicyResourcesWatcher) WatchDirectoryPolicyResources

func (p *PolicyResourcesWatcher) WatchDirectoryPolicyResources(ctx context.Context, policyManager PolicyManager)

WatchDirectoryPolicyResources starts watching Cilium Network policy files created under a directory.

type PolicyWatcherParams

type PolicyWatcherParams struct {
	cell.In

	ReadStatus DirectoryWatcherReadStatus
	Lifecycle  cell.Lifecycle
	Logger     logrus.FieldLogger
}

Jump to

Keyboard shortcuts

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