kubernetes.v0: gopkg.in/kubernetes/kubernetes.v0/pkg/admission Index | Files

package admission

import "gopkg.in/kubernetes/kubernetes.v0/pkg/admission"


Package Files

attributes.go chain.go errors.go handler.go interfaces.go plugins.go

func GetPlugins Uses

func GetPlugins() []string

GetPlugins enumerates the

func NewForbidden Uses

func NewForbidden(a Attributes, internalError error) error

NewForbidden is a utility function to return a well-formatted admission control error response

func RegisterPlugin Uses

func RegisterPlugin(name string, plugin Factory)

RegisterPlugin registers a plugin Factory by name. This is expected to happen during app startup.

type Attributes Uses

type Attributes interface {
    // GetName returns the name of the object as presented in the request.  On a CREATE operation, the client
    // may omit name and rely on the server to generate the name.  If that is the case, this method will return
    // the empty string
    GetName() string
    // GetNamespace is the namespace associated with the request (if any)
    GetNamespace() string
    // GetResource is the name of the resource being requested.  This is not the kind.  For example: pods
    GetResource() string
    // GetSubresource is the name of the subresource being requested.  This is a different resource, scoped to the parent resource, but it may have a different kind.
    // For instance, /pods has the resource "pods" and the kind "Pod", while /pods/foo/status has the resource "pods", the sub resource "status", and the kind "Pod"
    // (because status operates on pods). The binding resource for a pod though may be /pods/foo/binding, which has resource "pods", subresource "binding", and kind "Binding".
    GetSubresource() string
    // GetOperation is the operation being performed
    GetOperation() Operation
    // GetObject is the object from the incoming request prior to default values being applied
    GetObject() runtime.Object
    // GetKind is the type of object being manipulated.  For example: Pod
    GetKind() string
    // GetUserInfo is information about the requesting user
    GetUserInfo() user.Info

Attributes is an interface used by AdmissionController to get information about a request that is used to make an admission decision.

func NewAttributesRecord Uses

func NewAttributesRecord(object runtime.Object, kind, namespace, name, resource, subresource string, operation Operation, userInfo user.Info) Attributes

type Factory Uses

type Factory func(client client.Interface, config io.Reader) (Interface, error)

Factory is a function that returns an Interface for admission decisions. The config parameter provides an io.Reader handler to the factory in order to load specific configurations. If no configuration is provided the parameter is nil.

type Handler Uses

type Handler struct {
    // contains filtered or unexported fields

Handler is a base for admission control handlers that support a predefined set of operations

func NewHandler Uses

func NewHandler(ops ...Operation) *Handler

NewHandler creates a new base handler that handles the passed in operations

func (*Handler) Handles Uses

func (h *Handler) Handles(operation Operation) bool

Handles returns true for methods that this handler supports

type Interface Uses

type Interface interface {
    // Admit makes an admission decision based on the request attributes
    Admit(a Attributes) (err error)

    // Handles returns true if this admission controller can handle the given operation
    // where operation can be one of CREATE, UPDATE, DELETE, or CONNECT
    Handles(operation Operation) bool

Interface is an abstract, pluggable interface for Admission Control decisions.

func GetPlugin Uses

func GetPlugin(name string, client client.Interface, config io.Reader) (Interface, error)

GetPlugin creates an instance of the named plugin, or nil if the name is not known. The error return is only used if the named provider was known but failed to initialize. The config parameter specifies the io.Reader handler of the configuration file for the cloud provider, or nil for no configuration.

func InitPlugin Uses

func InitPlugin(name string, client client.Interface, configFilePath string) Interface

InitPlugin creates an instance of the named interface.

func NewChainHandler Uses

func NewChainHandler(handlers ...Interface) Interface

NewChainHandler creates a new chain handler from an array of handlers. Used for testing.

func NewFromPlugins Uses

func NewFromPlugins(client client.Interface, pluginNames []string, configFilePath string) Interface

NewFromPlugins returns an admission.Interface that will enforce admission control decisions of all the given plugins.

type Operation Uses

type Operation string

Operation is the type of resource operation being checked for admission control

const (
    Create  Operation = "CREATE"
    Update  Operation = "UPDATE"
    Delete  Operation = "DELETE"
    Connect Operation = "CONNECT"

Operation constants

Package admission imports 10 packages (graph). Updated 2018-03-12. Refresh now. Tools for package owners.