internal

package
v0.0.0-...-b25e952 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFromCRFormat

func ConvertFromCRFormat(data map[string][]string) map[string]IPs

func ConvertToCRFormat

func ConvertToCRFormat(info map[string]IPs) map[string][]string

func CreateDynamicKubeConfigClient

func CreateDynamicKubeConfigClient() (dynClient dynamic.Interface, err error)

func CreateOrUpdateNetworkConfig

func CreateOrUpdateNetworkConfig(info map[string][]string, resourceName, namespace string) error

func GenerateIPs

func GenerateIPs(ipList map[string]IPs, requestedIPs int, networkKey string) (randomValues []string, err error)

func GetLastIPDigit

func GetLastIPDigit(ip string) (string, error)

func LoadProfile

func LoadProfile(source, configLocation, configName string) (ipList map[string]IPs)

func LoadYAMLStructure

func LoadYAMLStructure(yamlData []byte) (ipList map[string]IPs)

func PrintBanner

func PrintBanner() string

OUTPUT BANNER + VERSION OUTPUT

func ReadYAMLFileFromDisk

func ReadYAMLFileFromDisk(filePath string) ([]byte, error)

READY YAML FILE FROM DISK

func SaveYAMLToDisk

func SaveYAMLToDisk(ipList map[string]IPs, filename string)

func TruncateIP

func TruncateIP(ip string) (string, error)

Types

type IPInfo

type IPInfo struct {
	Status  string `yaml:"status"`
	Cluster string `yaml:"cluster"`
}

type IPs

type IPs map[string]IPInfo

type NetworkConfig

type NetworkConfig struct {
	v1.TypeMeta   `json:",inline"`
	v1.ObjectMeta `json:"metadata,omitempty"`
	Spec          NetworkConfigSpec `json:"spec,omitempty"`
}

DEFINE THE NETWORKCONFIG STRUCT

func GetNetworkConfig

func GetNetworkConfig(resourceName, namespace string) (*NetworkConfig, error)

FUNCTION TO GET A NETWORKCONFIG RESOURCE

type NetworkConfigSpec

type NetworkConfigSpec struct {
	Networks map[string][]string `json:"networks"`
}

Jump to

Keyboard shortcuts

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