util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(list []string, strToSearch string) bool

Contains searches if a string list contains the given string or not.

func PatchService

func PatchService(ctx context.Context, client clientset.Interface, cur, mod *v1.Service) error

PatchService makes patch request to the Service object.

func RoundUpSize

func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64

RoundUpSize calculates how many allocation units are needed to accommodate a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS allocates volumes in gibibyte-sized chunks, RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2' (2 GiB is the smallest allocatable volume that can hold 1500MiB)

func StringListEqual

func StringListEqual(list1, list2 []string) bool

StringListEqual compares two string list, returns true if they have the same items, order doesn't matter

Types

type MyDuration

type MyDuration struct {
	time.Duration
}

MyDuration is the encoding.TextUnmarshaler interface for time.Duration

func (*MyDuration) UnmarshalText

func (d *MyDuration) UnmarshalText(text []byte) error

UnmarshalText is used to convert from text to Duration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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