Documentation ¶
Index ¶
- func AnnotateEnrolledPod(client kubernetes.Interface, pod *metav1.ObjectMeta) error
- func AnnotateUnenrollPod(client kubernetes.Interface, pod *metav1.ObjectMeta) error
- func Execute(cmd string, args ...string) error
- func ExecuteOutput(cmd string, args ...string) (string, error)
- func GetPlugin(rawPlugin any) (plugin map[string]any, err error)
- func GetPlugins(cniConfigMap map[string]any) (plugins []any, err error)
- func GetPodIPsIfPresent(pod *corev1.Pod) []netip.Addr
- func IsZtunnelPod(systemNs string, pod *corev1.Pod) bool
- func MarshalCNIConfig(cniConfigMap map[string]any) ([]byte, error)
- func PodRedirectionEnabled(namespace *corev1.Namespace, pod *corev1.Pod) bool
- func ReadCNIConfigMap(path string) (map[string]any, error)
- type ExecList
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateEnrolledPod ¶
func AnnotateEnrolledPod(client kubernetes.Interface, pod *metav1.ObjectMeta) error
func AnnotateUnenrollPod ¶
func AnnotateUnenrollPod(client kubernetes.Interface, pod *metav1.ObjectMeta) error
func GetPlugin ¶
Given the raw plugin interface, return the plugin asserted as a map[string]interface{}
func GetPlugins ¶
Given an unmarshalled CNI config JSON map, return the plugin list asserted as a []interface{}
func GetPodIPsIfPresent ¶
Get any IPs currently assigned to the Pod.
If 'PodIPs' exists, it is preferred (and should be guaranteed to contain the address in 'PodIP'), otherwise fallback to 'PodIP'.
Note that very early in the pod's lifecycle (before all the node CNI plugin invocations finish) K8S may not have received the pod IPs yet, and may not report the pod as having any.
func MarshalCNIConfig ¶
Marshal the CNI config map and append a new line
func PodRedirectionEnabled ¶
PodRedirectionEnabled determines if a pod should or should not be configured to have traffic redirected thru the node proxy.
Types ¶
type Watcher ¶
type Watcher struct { Events chan struct{} Errors chan error // contains filtered or unexported fields }
func CreateFileWatcher ¶
Creates a file watcher that watches for any changes to the directory