util

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Verbose = false

Verbose logging

Functions

func Clientset

func Clientset() kubernetes.Interface

Clientset abstracts the cluster config loading both locally and on Kubernetes

func ErrorPrintHelpAndExit

func ErrorPrintHelpAndExit(options interface{}, message string)

ErrorPrintHelpAndExit prints the message, the help message and exits

func GetNodeInfo

func GetNodeInfo(name string) (string, string, string, error)

GetNodeInfo returns the node name, environment and datacenter from a fqdn

func InstallSignalHandler

func InstallSignalHandler(stop chan struct{})

InstallSignalHandler sends a message on sigint or sigterm

func ParseArgs

func ParseArgs(options interface{})

ParseArgs needs a struct compatible to jeddevdk/go-flags and will fill it based on CLI parameters.

func PrepareMergePatchData

func PrepareMergePatchData(path string, value interface{}) (data []byte, err error)

PrepareMergePatchData generates JSON merge patch payload to be used in k8s Patch methods

func PrepareUpdateMap

func PrepareUpdateMap(updates map[string]interface{}, path string, key string, value interface{}) error

PrepareUpdateMap alters the map of updates by adding the key/value in the given path

Types

type KeyFileStruct

type KeyFileStruct struct {
	Version string    `json:"version"`
	Keys    RawKeyMap `json:"keys"`
}

type KeyMap

type KeyMap map[int]string

func ConvertRawDataToKeyMap

func ConvertRawDataToKeyMap(bytes []byte) KeyMap

Convert file content to a key map

func GetMasterKeysAndRemoveKeyFile

func GetMasterKeysAndRemoveKeyFile() KeyMap

Called as one of the first steps of agent/server programs (before it can crash). When running under Mesos, it removes the password file from the Mesos sandbox.

type RawKeyMap

type RawKeyMap map[string]string

Jump to

Keyboard shortcuts

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