utils

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package utils define some common used functions&structs

Package utils define some common used functions&structs

Index

Constants

View Source
const (
	GroupVersionV2      = "v2"
	GroupVersionV2Beta2 = "v2beta2"
)

Variables

View Source
var (
	// GroupVersionsVPA is a list of group versions for vertical pod autoscaler
	// It should be updated when the watched crd use a new version
	GroupVersionsVPA = []string{"autoscaling.k8s.io/v1"}

	GroupVersionAutoscalingV2 = []string{autoscalingv2.SchemeGroupVersion.String()}

	GroupVersionAutoscalingV2Beta2 = []string{autoscalingv2beta2.SchemeGroupVersion.String()}
)
View Source
var EnableInitContainers = false

Functions

This section is empty.

Types

type GroupVersionFlags added in v0.15.0

type GroupVersionFlags struct {
	// the controller should not watch VPA CRDs if WatchVPACRDs is false
	WatchVPACRDs bool

	// the controller should provide the HPA group version via APIAutoscalingGroupVersion
	APIAutoscalingGroupVersion string
}

type GroupVersions

type GroupVersions map[string]bool

GroupVersions is a set of Kubernetes API group versions.

func GetGroupVersions

func GetGroupVersions(client discovery.ServerGroupsInterface) (GroupVersions, error)

GetGroupVersions will get all group versions in the cluster

func (GroupVersions) Has

func (v GroupVersions) Has(apiVersion string) bool

Has returns true if the version string is in the set.

vs.Has("apps/v1")

func (GroupVersions) HasGroupVersions

func (v GroupVersions) HasGroupVersions(versions []string) bool

HasGroupVersions returns true if the versions are both in the set

Jump to

Keyboard shortcuts

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