kubernetes: github.com/igm/kubernetes/pkg/registry/binding Index | Files

package binding

import "github.com/igm/kubernetes/pkg/registry/binding"

Package binding contains the middle layer logic for bindings. Bindings are objects containing instructions for how a pod ought to be bound to a host. This allows a registry object which supports this action (ApplyBinding) to be served through an apiserver.

Index

Package Files

doc.go mock.go registry.go rest.go

type MockRegistry Uses

type MockRegistry struct {
    OnApplyBinding func(binding *api.Binding) error
}

MockRegistry can be used for testing.

func (MockRegistry) ApplyBinding Uses

func (mr MockRegistry) ApplyBinding(ctx api.Context, binding *api.Binding) error

type REST Uses

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

REST implements the RESTStorage interface for bindings. When bindings are written, it changes the location of the affected pods. This information is eventually reflected in the pod's CurrentState.Host field.

func NewREST Uses

func NewREST(bindingRegistry Registry) *REST

NewREST creates a new REST backed by the given bindingRegistry.

func (*REST) Create Uses

func (b *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error)

Create attempts to make the assignment indicated by the binding it recieves.

func (*REST) Delete Uses

func (*REST) Delete(ctx api.Context, id string) (<-chan apiserver.RESTResult, error)

Delete returns an error because bindings are write-only objects.

func (*REST) Get Uses

func (*REST) Get(ctx api.Context, id string) (runtime.Object, error)

Get returns an error because bindings are write-only objects.

func (*REST) List Uses

func (*REST) List(ctx api.Context, label, field labels.Selector) (runtime.Object, error)

List returns an error because bindings are write-only objects.

func (*REST) New Uses

func (*REST) New() runtime.Object

New returns a new binding object fit for having data unmarshalled into it.

func (*REST) Update Uses

func (b *REST) Update(ctx api.Context, obj runtime.Object) (<-chan apiserver.RESTResult, error)

Update returns an error-- this object may not be updated.

type Registry Uses

type Registry interface {
    // ApplyBinding should apply the binding. That is, it should actually
    // assign or place pod binding.PodID on machine binding.Host.
    ApplyBinding(ctx api.Context, binding *api.Binding) error
}

Registry contains the functions needed to support a BindingStorage.

Package binding imports 6 packages (graph). Updated 2018-04-17. Refresh now. Tools for package owners.