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.
Click to show internal directories.
Click to hide internal directories.