util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindNodeIPv6

func FindNodeIPv6(node *corev1.Node) net.IP

FindNodeIPv6 returns the first IPv6 address of the node's InternalIPs, nil if not found.

func FormatIPNets

func FormatIPNets(ipNets []*net.IPNet) string

FormatIPNets returns the string representation of a slice of net.IPNet.

func IsV4

func IsV4(ip net.IP) bool

IsV4 checks if a net.IP is an IPv4 address.

func IsV6

func IsV6(ip net.IP) bool

IsV6 checks if a net.IP is an IPv6 address.

func NewUID

func NewUID() string

NewUID tries to return a locally unique ID. Don't use it concurrently. Not thread safe.

func ParseIPNets

func ParseIPNets(ipNetStrings []string) ([]*net.IPNet, error)

ParseIPNets returns the parsed subnets.

func ParseNodePodCIDRs

func ParseNodePodCIDRs(node *corev1.Node) ([]*net.IPNet, error)

ParseNodePodCIDRs returns the pod CIDRs of the node.

Types

type Tables

type Tables struct {
	*iptables.IPTables
}

Tables wraps iptables.IPTables.

var (
	V4tables *Tables
	V6tables *Tables
)

func (*Tables) InsertUnique

func (t *Tables) InsertUnique(table, chain string, pos int, rulespec ...string) error

InsertUnique inserts a rule if it doesn't already exist.

func (*Tables) NewChainUnique

func (t *Tables) NewChainUnique(table, chain string) error

NewChainUnique creates a chain if it doesn't already exist.

Jump to

Keyboard shortcuts

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