resources

package
v0.0.0-...-88490aa Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package resources contains constants and data structures corresponding to the different resources defined in the Kubernetes API.

Index

Constants

View Source
const PVNamespace = "default"

Persistent volumes are not namespaced, so use the default namespace.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerDesc

type ContainerDesc struct {
	Name      string
	Image     string
	Command   string
	PVCMounts []VolumeMount
}

ContainerDesc provides an abstraction that allows us to pass around the relevant parts of a container more easily.

type PVCResource

type PVCResource struct {
	api.PersistentVolumeClaim
}

PVResource wraps an api.PersistentVolumeClaim and implements the Resource interface.

func (*PVCResource) GetRV

func (p *PVCResource) GetRV() string

func (*PVCResource) GetUID

func (p *PVCResource) GetUID() types.UID

func (*PVCResource) String

func (p *PVCResource) String() string

type PVResource

type PVResource struct {
	api.PersistentVolume
}

PVResource wraps an api.PersistentVolume and implements the Resource interface.

func (*PVResource) GetRV

func (p *PVResource) GetRV() string

func (*PVResource) GetUID

func (p *PVResource) GetUID() types.UID

func (*PVResource) String

func (p *PVResource) String() string

type PodResource

type PodResource struct {
	api.Pod
}

PodResource wraps an api.Pod and implements the Resource interface.

func (*PodResource) GetRV

func (p *PodResource) GetRV() string

func (*PodResource) GetUID

func (p *PodResource) GetUID() types.UID

func (*PodResource) String

func (p *PodResource) String() string

type Resource

type Resource interface {
	GetUID() types.UID
	GetRV() string
	String() string // Here for debugging purposes.
}

Resource is used to wrap Kubernetes API elements to provide some degree of polymorphism for basic methods (getting the UID and resource version of an object, as well as its string representation).

type ResourceType

type ResourceType string

ResourceType corresponds to the different API server endpoints (and, correspondingly, resources) that we care about.

const (
	Pods ResourceType = "pods"
	PVs  ResourceType = "persistentvolumes"
	PVCs ResourceType = "persistentvolumeclaims"
)

type VolumeMount

type VolumeMount struct {
	Name     string
	ReadOnly bool
}

VolumeMount represents a PVC mount point for a container.

Jump to

Keyboard shortcuts

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