Documentation
¶
Index ¶
- Constants
- Variables
- func AddBoolAnnotations(annot map[string]string, curPeriod *periodPkg.Period, value bool) map[string]string
- func AddIntAnnotations(annot map[string]string, curPeriod *periodPkg.Period, value *int32) map[string]string
- func AddMinMaxAnnotations(annot map[string]string, curPeriod *periodPkg.Period, min *int32, max int32) map[string]string
- func PrepareSearch(ctx context.Context, config *Config) ([]string, metaV1.ListOptions, error)
- func RemoveAnnotations(annotations map[string]string) map[string]string
- func RestoreBoolAnnotations(annot map[string]string) (bool, *bool, map[string]string, error)
- func RestoreIntAnnotations(annot map[string]string) (bool, *int32, map[string]string, error)
- func RestoreMinMaxAnnotations(annot map[string]string) (bool, *int32, int32, map[string]string, error)
- func SetNamespaceList(ctx context.Context, config *Config) ([]string, error)
- type Config
- type K8sResource
Constants ¶
View Source
const ( AnnotationsPrefix = "cloudscaler.io" AnnotationsOrigValue = "original-value" AnnotationsMinOrigValue = "min-original-value" AnnotationsMaxOrigValue = "max-original-value" PeriodType = "period-type" PeriodStartTime = "period-start-time" PeriodEndTime = "period-end-time" PeriodTimezone = "period-timezone" )
Variables ¶
View Source
var (
DefaultExcludeNamespaces = []string{"kube-system"}
)
Functions ¶
func AddBoolAnnotations ¶ added in v1.2.0
func AddIntAnnotations ¶ added in v1.2.0
func AddMinMaxAnnotations ¶ added in v1.2.1
func PrepareSearch ¶
func RestoreBoolAnnotations ¶ added in v1.2.1
func RestoreIntAnnotations ¶ added in v1.2.1
func RestoreMinMaxAnnotations ¶ added in v1.2.1
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"`
ForceExcludeSystemNamespaces bool `json:"forceExcludeSystemNamespaces,omitempty"`
}
type K8sResource ¶
type K8sResource struct {
NsList []string
ListOptions metaV1.ListOptions
Period *periodPkg.Period `json:"period,omitempty"`
}
func InitConfig ¶ added in v1.0.3
func InitConfig(ctx context.Context, config *Config) (*K8sResource, error)
Click to show internal directories.
Click to hide internal directories.