helper

package
v0.17.11-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 6 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIServiceNameToGroupVersion

func APIServiceNameToGroupVersion(apiServiceName string) schema.GroupVersion

APIServiceNameToGroupVersion returns the GroupVersion for a given apiServiceName. The name must be valid, but any object you get back from an informer will be valid.

func GetAPIServiceConditionByType

func GetAPIServiceConditionByType(apiService *v1.APIService, conditionType v1.APIServiceConditionType) *v1.APIServiceCondition

GetAPIServiceConditionByType gets an *APIServiceCondition by APIServiceConditionType if present

func IsAPIServiceConditionTrue

func IsAPIServiceConditionTrue(apiService *v1.APIService, conditionType v1.APIServiceConditionType) bool

IsAPIServiceConditionTrue indicates if the condition is present and strictly true

func NewLocalAvailableAPIServiceCondition

func NewLocalAvailableAPIServiceCondition() v1.APIServiceCondition

NewLocalAvailableAPIServiceCondition returns a condition for an available local APIService.

func SetAPIServiceCondition

func SetAPIServiceCondition(apiService *v1.APIService, newCondition v1.APIServiceCondition)

SetAPIServiceCondition sets the status condition. It either overwrites the existing one or creates a new one

func SortedByGroupAndVersion

func SortedByGroupAndVersion(servers []*v1.APIService) [][]*v1.APIService

SortedByGroupAndVersion sorts APIServices into their different groups, and then sorts them based on their versions. For example, the first element of the first array contains the APIService with the highest version number, in the group with the highest priority; while the last element of the last array contains the APIService with the lowest version number, in the group with the lowest priority.

Types

type ByGroupPriorityMinimum

type ByGroupPriorityMinimum []*v1.APIService

ByGroupPriorityMinimum sorts with the highest group number first, then by name. This is not a simple reverse, because we want the name sorting to be alpha, not reverse alpha.

func (ByGroupPriorityMinimum) Len

func (s ByGroupPriorityMinimum) Len() int

func (ByGroupPriorityMinimum) Less

func (s ByGroupPriorityMinimum) Less(i, j int) bool

func (ByGroupPriorityMinimum) Swap

func (s ByGroupPriorityMinimum) Swap(i, j int)

type ByVersionPriority

type ByVersionPriority []*v1.APIService

ByVersionPriority sorts with the highest version number first, then by name. This is not a simple reverse, because we want the name sorting to be alpha, not reverse alpha.

func (ByVersionPriority) Len

func (s ByVersionPriority) Len() int

func (ByVersionPriority) Less

func (s ByVersionPriority) Less(i, j int) bool

func (ByVersionPriority) Swap

func (s ByVersionPriority) Swap(i, j int)

Jump to

Keyboard shortcuts

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