common

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const PasswordField string = "password"
View Source
const PodNamePrefix string = "armada-"
View Source
const UsernameField string = "username"

Variables

This section is empty.

Functions

func BindCommandlineArguments

func BindCommandlineArguments()

func ConfigureCommandLineLogging

func ConfigureCommandLineLogging()

func ConfigureLogging

func ConfigureLogging()

func ContextWithDefaultTimeout

func ContextWithDefaultTimeout() (context.Context, context.CancelFunc)

func LoadConfig

func LoadConfig(config interface{}, defaultPath string, overrideConfigs []string) *viper.Viper

func QuantityAsFloat64

func QuantityAsFloat64(q resource.Quantity) float64

func ServeHttp added in v0.0.5

func ServeHttp(port uint16, mux http.Handler) (shutdown func())

func ServeMetrics

func ServeMetrics(port uint16) (shutdown func())

func ServeMetricsFor added in v0.1.29

func ServeMetricsFor(port uint16, gatherer prometheus.Gatherer) (shutdown func())

func UnmarshalKey added in v0.1.14

func UnmarshalKey(v *viper.Viper, key string, item interface{}) error

Types

type ComputeResources

type ComputeResources map[string]resource.Quantity

func CalculateTotalResource

func CalculateTotalResource(nodes []*v1.Node) ComputeResources

func CalculateTotalResourceRequest

func CalculateTotalResourceRequest(pods []*v1.Pod) ComputeResources

func FromResourceList

func FromResourceList(list v1.ResourceList) ComputeResources

func TotalJobResourceRequest added in v0.1.23

func TotalJobResourceRequest(job *api.Job) ComputeResources

func TotalPodResourceRequest added in v0.1.23

func TotalPodResourceRequest(podSpec *v1.PodSpec) ComputeResources

Resource request for a given pod is the maximum of: - sum of all containers - any individual init container This is because: - containers run in parallel (so need to sum resources) - init containers run sequentially (so only their individual resource need be considered) So pod resource usage is the max for each resource type (cpu/memory etc) that could be used at any given time

func (ComputeResources) Add

func (ComputeResources) AsFloat

func (ComputeResources) DeepCopy

func (a ComputeResources) DeepCopy() ComputeResources

func (ComputeResources) Dominates added in v0.1.6

func (a ComputeResources) Dominates(b ComputeResources) bool

func (ComputeResources) Equal added in v0.1.6

func (ComputeResources) IsValid added in v0.1.6

func (a ComputeResources) IsValid() bool

func (ComputeResources) Max

func (ComputeResources) Mul

func (ComputeResources) MulByResource added in v0.1.0

func (a ComputeResources) MulByResource(factors map[string]float64) ComputeResourcesFloat

func (ComputeResources) String added in v0.1.9

func (a ComputeResources) String() string

func (ComputeResources) Sub

type ComputeResourcesFloat

type ComputeResourcesFloat map[string]float64

float version of compute resource, prefer calculations with quantity where possible

func (ComputeResourcesFloat) Add

func (ComputeResourcesFloat) DeepCopy

func (ComputeResourcesFloat) IsLessThan

func (ComputeResourcesFloat) IsValid

func (a ComputeResourcesFloat) IsValid() bool

func (ComputeResourcesFloat) LimitToZero added in v0.1.6

func (a ComputeResourcesFloat) LimitToZero()

func (ComputeResourcesFloat) LimitWith added in v0.0.2

func (ComputeResourcesFloat) Max added in v0.1.6

func (ComputeResourcesFloat) MergeWith added in v0.1.6

The merged in values take precedence and override existing values for the same key

func (ComputeResourcesFloat) Mul added in v0.0.2

func (ComputeResourcesFloat) Sub

type LoginCredentials

type LoginCredentials struct {
	Username string
	Password string
}

func (*LoginCredentials) GetRequestMetadata

func (c *LoginCredentials) GetRequestMetadata(context.Context, ...string) (map[string]string, error)

func (*LoginCredentials) RequireTransportSecurity

func (c *LoginCredentials) RequireTransportSecurity() bool

Jump to

Keyboard shortcuts

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