limitrange

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMemoryConfig

func WithMemoryConfig(ctx context.Context, cfg *Config) context.Context

Types

type Config

type Config struct {
	HasDefaultRequest       bool
	HasDefaultLimit         bool
	HasMaxLimitRequestRatio bool
	DefaultLimit            resource.Quantity
	DefaultRequest          resource.Quantity
	MaxLimitRequestRatio    resource.Quantity
}

func MemoryConfigFromContext

func MemoryConfigFromContext(ctx context.Context) (*Config, error)

func NewConfig

func NewConfig(lri corev1.LimitRangeItem, resource corev1.ResourceName) Config

type LimitRange

type LimitRange struct {
	// contains filtered or unexported fields
}

LimitRange provides an implementation of the LimitRanger interface defined in admission. This implementation is designed to provider a generic config sourcing tool for all mutation handlers.

func NewLimitRanger

func NewLimitRanger(lister corev1Listers.LimitRangeLister) *LimitRange

NewLimitRanger take a limitrangelister and returns a pointer to a configured LimitRange. This satisfies the LimitRanger interface

func (*LimitRange) LimitRangeConfig

func (lr *LimitRange) LimitRangeConfig(namespace string) (*Config, error)

LimitRangeConfig takes a namespace string and returns a Config for memory or a nil if no limit range of type Container is found in the namespace. It returns a non-nil error if there is an error sourcing data from the cluster api or the namespace name is empty

type LimitRangeContextType

type LimitRangeContextType string
const LimitRangeContextTypeMemory LimitRangeContextType = "memory"

Jump to

Keyboard shortcuts

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