utils

package
v0.1.0-beta.12 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operator auto-created flat-network service name suffix
	FlatNetworkServiceNameSuffix = "-flat-network"

	K8sCNINetworksKey       = "k8s.v1.cni.cncf.io/networks"
	K8sCNINetworksStatusKey = "k8s.v1.cni.cncf.io/network-status"
	NetAttatchDefName       = "rancher-flat-network"
)

Variables

View Source
var (
	Version   = "v0.1.0"
	GitCommit = ""
)

Functions

func GID

func GID() uint64

GID returns current go routine ID

func Hostname

func Hostname() string

Hostname returns current hostname.

func IsFlatNetworkService

func IsFlatNetworkService(svc *corev1.Service) bool

Check if this service is a flat-network service.

Specification: A Flat-Network Service is a ClusterIP typed headless service, name ends with '-flat-network' suffix. And should have 'k8s.v1.cni.cncf.io/networks: rancher-flat-network' annotation.

func IsPodEnabledFlatNetwork

func IsPodEnabledFlatNetwork(pod *corev1.Pod) bool

IsPodEnabledFlatNetwork returns true if the pod enables flatnetwork

func Print

func Print(a any) string

func Ptr

func Ptr[T valueTypes](i T) *T

Ptr gets the pointer of the variable.

func Value

func Value[T valueTypes](p *T) T

A safe function to get the value from the pointer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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