policyexample

package
v2.36.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: GPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPolicyIndex added in v1.0.3

func GetPolicyIndex(runtimeInfo policy.RuntimeReader) (string, error)

GetPolicyIndex assumes that one of the labels of the PU is PolicyIndex and returns the corresponding value

func LoadPolicies added in v1.0.3

func LoadPolicies(file string) map[string]*CachedPolicy

LoadPolicies loads a set of policies defined in a JSON file

Types

type CachedPolicy added in v1.0.3

type CachedPolicy struct {
	ApplicationACLs *policy.IPRuleList
	NetworkACLs     *policy.IPRuleList
	Dependencies    policy.TagSelectorList
	ExposureRules   policy.TagSelectorList
}

CachedPolicy is a policy for a single container as read by a file

type CustomPolicyResolver

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

CustomPolicyResolver is a simple policy engine

func NewCustomPolicyResolver

func NewCustomPolicyResolver(controller controller.TriremeController, networks []string, policyFile string) *CustomPolicyResolver

NewCustomPolicyResolver creates a new example policy engine for the Trireme package

func (*CustomPolicyResolver) HandlePUEvent

func (p *CustomPolicyResolver) HandlePUEvent(ctx context.Context, puID string, event common.Event, runtimeInfo policy.RuntimeReader) error

HandlePUEvent implements the Trireme Policy interface. Once policy is resolved the resolver must call the controller to enforce the policy.

Jump to

Keyboard shortcuts

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