utils

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

View Source
const (

	// ResourceTypeCiliumNetworkPolicy is the resource type used for the
	// PolicyLabelDerivedFrom label
	ResourceTypeCiliumNetworkPolicy = "CiliumNetworkPolicy"

	// ResourceTypeCiliumClusterwideNetworkPolicy is the resource type used for the
	// PolicyLabelDerivedFrom label
	ResourceTypeCiliumClusterwideNetworkPolicy = "CiliumClusterwideNetworkPolicy"
)

Variables

This section is empty.

Functions

func GetPolicyLabels

func GetPolicyLabels(ns, name string, uid types.UID, derivedFrom string) labels.LabelArray

GetPolicyLabels returns a LabelArray for the given namespace and name.

func ParseToCiliumLabels

func ParseToCiliumLabels(namespace, name string, uid types.UID, ruleLbs labels.LabelArray) labels.LabelArray

ParseToCiliumLabels returns all ruleLbls appended with a specific label that represents the given namespace and name along with a label that specifies these labels were derived from a CiliumNetworkPolicy.

func ParseToCiliumRule

func ParseToCiliumRule(namespace, name string, uid types.UID, r *api.Rule) *api.Rule

ParseToCiliumRule returns an api.Rule with all the labels parsed into cilium labels. If the namespace provided is empty then the rule is cluster scoped, this might happen in case of CiliumClusterwideNetworkPolicy which enforces a policy on the cluster instead of the particular namespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

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