utils

package
v0.0.0-...-a143e3c Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreLabelsContained

func AreLabelsContained(needle map[string]string, haystack map[string]string) bool

AreLabelsContained checks if the labels in the first argument are present in the second one and values are the same. Basically checks if a map is a sub-map.

func BuildObjectKey

func BuildObjectKey(obj *pcn_types.ObjectQuery, peerType string) string

BuildObjectKey builds the key of an object based on its query

func BuildQuery

func BuildQuery(name string, labels map[string]string) *pcn_types.ObjectQuery

BuildQuery builds a query to be sent to a controller

func GetPodVirtualIP

func GetPodVirtualIP(ip string) string

GetPodVirtualIP gets a pod's virtual IP starting from the IP assigned to it

func ImplodeLabels

func ImplodeLabels(labels map[string]string, sep string, sortKeys bool) string

ImplodeLabels set labels in a key1=value1,key2=value2 format Values are separated by sep and the third value specifies if keys should be sorted.

func SetVPodsRange

func SetVPodsRange(vrange *net.IPNet)

Types

type HostNetworkConf

type HostNetworkConf struct {
	DefaultIface  string
	NodeportIface string
	PrivateMask   net.IPMask
}

Describes the network configuration of the host

func GetHostNetworkConf

func GetHostNetworkConf(NodeIP string) (conf HostNetworkConf, err error)

TODO: Improve, it should be used together with the k8s node api

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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