Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeHandler ¶
type AttributeHandler interface { ConvertLabels(targetPodLabels map[string]string) map[string][]string GetLocalEnvVars(obj metav1.Object) (map[string]string, error) GetLabelsFromEnvVars(envVars map[string]string) (map[string][]string, error) MergeLabels(targetLabels ...map[string][]string) (map[string][]string, error) }
type Handler ¶
type Handler struct { Client kubernetes.Interface DyanmicClient dynamic.Interface NetworkPolicyHandler NetworkPolicyHandler ObjectHandler ObjectHandler AttributeHandler AttributeHandler }
func (*Handler) HandleAdd ¶
HandleAdd handles the case when a K8s object of interest is added to the cluster, and creates a NetworkPolicy for it
func (*Handler) HandleDelete ¶
HandleDelete handles the case when an object of interest is deleted from the cluster. If the object had a NetworkPolicy belonging to it, the policy gets deleted
func (*Handler) HandleUpdate ¶
HandleUpdate handles the case when a K8s object of interest is updated in the cluster, provided the object's environment variables or labels have changed
type NetworkPolicyHandler ¶
type NetworkPolicyHandler interface { NewPolicy(name string, namespace string, podSelectorLabels map[string]string, targetPodLabels map[string][]string) (*networkingv1.NetworkPolicy, error) GetPolicyByPodLabels(namespace string, podLabels map[string]string) (*networkingv1.NetworkPolicy, error) AppendLabelsToPeers(targetPodLabels map[string][]string) (ingressPeers []networkingv1.NetworkPolicyPeer, egressPeers []networkingv1.NetworkPolicyPeer, err error) }
Click to show internal directories.
Click to hide internal directories.