kubernetes: github.com/asteris-llc/kubernetes/plugin/pkg/admission/limitranger Index | Files

package limitranger

import "github.com/asteris-llc/kubernetes/plugin/pkg/admission/limitranger"


Package Files

admission.go interfaces.go

func Max Uses

func Max(a int64, b int64) int64

Max returns the greater of its 2 arguments

func Min Uses

func Min(a int64, b int64) int64

Min returns the lesser of its 2 arguments

func NewLimitRanger Uses

func NewLimitRanger(client clientset.Interface, actions LimitRangerActions) (admission.Interface, error)

NewLimitRanger returns an object that enforces limits based on the supplied limit function

func PodLimitFunc Uses

func PodLimitFunc(limitRange *api.LimitRange, pod *api.Pod) error

PodLimitFunc enforces resource requirements enumerated by the pod against the specified LimitRange. The pod may be modified to apply default resource requirements if not specified, and enumerated on the LimitRange

type DefaultLimitRangerActions Uses

type DefaultLimitRangerActions struct{}

DefaultLimitRangerActions is the default implementatation of LimitRangerActions.

func (*DefaultLimitRangerActions) Limit Uses

func (d *DefaultLimitRangerActions) Limit(limitRange *api.LimitRange, resourceName string, obj runtime.Object) error

Limit enforces resource requirements of incoming resources against enumerated constraints on the LimitRange. It may modify the incoming object to apply default resource requirements if not specified, and enumerated on the LimitRange

func (*DefaultLimitRangerActions) SupportsAttributes Uses

func (d *DefaultLimitRangerActions) SupportsAttributes(a admission.Attributes) bool

SupportsAttributes ignores all calls that do not deal with pod resources since that is all this supports now. Also ignores any call that has a subresource defined.

func (*DefaultLimitRangerActions) SupportsLimit Uses

func (d *DefaultLimitRangerActions) SupportsLimit(limitRange *api.LimitRange) bool

SupportsLimit always returns true.

type LimitRangerActions Uses

type LimitRangerActions interface {
    // Limit is a pluggable function to enforce limits on the object.
    Limit(limitRange *api.LimitRange, kind string, obj runtime.Object) error
    // SupportsAttributes is a pluggable function to allow overridding what resources the limitranger
    // supports.
    SupportsAttributes(attr admission.Attributes) bool
    // SupportsLimit is a pluggable function to allow ignoring limits that should not be applied
    // for any reason.
    SupportsLimit(limitRange *api.LimitRange) bool

Package limitranger imports 15 packages (graph). Updated 2019-02-24. Refresh now. Tools for package owners.