util

package
v0.0.0-...-8023bdc Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 19 Imported by: 10

Documentation

Index

Constants

View Source
const (
	SystemTenant   = apiv1.NamespaceDefault
	SystemPassword = "password"

	SystemNetwork = apiv1.NamespaceDefault
)

Variables

View Source
var ErrMultipleResults = errors.New("MultipleResults")
View Source
var ErrNotFound = errors.New("NotFound")

Functions

func BuildFullPodName

func BuildFullPodName(namespace, name string) string

func BuildLoadBalancerName

func BuildLoadBalancerName(namespace, name string) string

func BuildNetworkName

func BuildNetworkName(namespace, name string) string

func BuildPortName

func BuildPortName(namespace, podName string) string

func FlushLogs

func FlushLogs()

FlushLogs flushes logs immediately.

func InitFlags

func InitFlags()

InitFlags normalizes and parses the command line flags

func InitLogs

func InitLogs()

InitLogs initializes logs the way we want for kubernetes.

func IsSystemNamespace

func IsSystemNamespace(ns string) bool

func LoadBalancerStatusDeepCopy

func LoadBalancerStatusDeepCopy(lb *v1.LoadBalancerStatus) *v1.LoadBalancerStatus

func LoadBalancerStatusEqual

func LoadBalancerStatusEqual(l, r *v1.LoadBalancerStatus) bool
func NetnsSymlink(source, dest string) error

NetnsSymlink make a symlink for a netns path.

func NewClusterConfig

func NewClusterConfig(kubeConfig string) (*rest.Config, error)

NewClusterConfig builds a kubernetes cluster config.

func NewLogger

func NewLogger(prefix string) *log.Logger

NewLogger creates a new log.Logger which sends logs to glog.Info.

func RunCommand

func RunCommand(cmd string, args ...string) ([]string, error)

func WaitForCRDReady

func WaitForCRDReady(clientset apiextensionsclient.Interface, crdName string) error

func WarnWordSepNormalizeFunc

func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators

func WordSepNormalizeFunc

func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName

WordSepNormalizeFunc changes all flags that contain "_" separators

Types

type GlogWriter

type GlogWriter struct{}

GlogWriter serves as a bridge between the standard log package and the glog package.

func (GlogWriter) Write

func (writer GlogWriter) Write(data []byte) (n int, err error)

Write implements the io.Writer interface.

Jump to

Keyboard shortcuts

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