pod

package
v0.9.1-0...-c65f83f Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pod provides Registry interface and it's RESTStorage implementation for storing Pod api objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PodToSelectableFields

func PodToSelectableFields(pod *api.Pod) labels.Set

Types

type BasicBoundPodFactory

type BasicBoundPodFactory struct {
	// TODO: this should really point at the API rather than a registry
	ServiceRegistry        service.Registry
	MasterServiceNamespace string
}

func (*BasicBoundPodFactory) MakeBoundPod

func (b *BasicBoundPodFactory) MakeBoundPod(machine string, pod *api.Pod) (*api.BoundPod, error)

type BoundPodFactory

type BoundPodFactory interface {
	// Make a container object for a given pod, given the machine that the pod is running on.
	MakeBoundPod(machine string, pod *api.Pod) (*api.BoundPod, error)
}

type PodStatusGetter

type PodStatusGetter interface {
	GetPodStatus(namespace, name string) (*api.PodStatus, error)
}

type REST

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

REST implements the RESTStorage interface in terms of a PodRegistry.

func NewREST

func NewREST(config *RESTConfig) *REST

NewREST returns a new REST.

func (*REST) Create

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

func (*REST) Delete

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

func (*REST) Get

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

func (*REST) List

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

func (*REST) New

func (*REST) New() runtime.Object

func (*REST) NewList

func (*REST) NewList() runtime.Object

func (*REST) ResourceLocation

func (rs *REST) ResourceLocation(ctx api.Context, id string) (string, error)

ResourceLocation returns a URL to which one can send traffic for the specified pod.

func (*REST) Update

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

func (*REST) Watch

func (rs *REST) Watch(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)

Watch begins watching for new, changed, or deleted pods.

type RESTConfig

type RESTConfig struct {
	PodCache PodStatusGetter
	Registry Registry
}

type Registry

type Registry interface {
	// ListPods obtains a list of pods having labels which match selector.
	ListPods(ctx api.Context, selector labels.Selector) (*api.PodList, error)
	// ListPodsPredicate obtains a list of pods for which filter returns true.
	ListPodsPredicate(ctx api.Context, filter func(*api.Pod) bool) (*api.PodList, error)
	// Watch for new/changed/deleted pods
	WatchPods(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error)
	// Get a specific pod
	GetPod(ctx api.Context, podID string) (*api.Pod, error)
	// Create a pod based on a specification.
	CreatePod(ctx api.Context, pod *api.Pod) error
	// Update an existing pod
	UpdatePod(ctx api.Context, pod *api.Pod) error
	// Delete an existing pod
	DeletePod(ctx api.Context, podID string) error
}

Registry is an interface implemented by things that know how to store Pod objects.

Jump to

Keyboard shortcuts

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