utils

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AnnotationsPrefix  = "cloudscaler.io"
	NominalMinReplicas = "nominal-min-replicas"
	NominalMaxReplicas = "nominal-max-replicas"
	PeriodType         = "period-type"
	PeriodStartTime    = "period-start-time"
	PeriodEndTime      = "period-end-time"
	PeriodTimezone     = "period-timezone"
)

Variables

View Source
var (
	DefaultExcludeNamespace = []string{"kube-system"}
)

Functions

func AddAnnotations

func AddAnnotations(annotations map[string]string, period *common.ScalerPeriod) map[string]string

func PrepareSearch

func PrepareSearch(ctx context.Context, config *Config) ([]string, metaV1.ListOptions, error)

func RemoveAnnotations

func RemoveAnnotations(annotations map[string]string) map[string]string

func SetNamespaceList

func SetNamespaceList(ctx context.Context, config *Config) ([]string, error)

We set namespaces into resources to be able to use k8s client

Types

type Config

type Config struct {
	Namespaces        []string              `json:"namespaces,omitempty"`
	ExcludeNamespaces []string              `json:"excludeNamespaces,omitempty"`
	Client            *kubernetes.Clientset `json:"client"`
	LabelSelector     *metaV1.LabelSelector `json:"labelSelector,omitempty"`
	Period            *periodPkg.Period     `json:"period,omitempty"`
}

type K8sResource

type K8sResource struct {
	Config      *Config
	NsList      []string
	ListOptions metaV1.ListOptions
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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