k8s

package
v2.4.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ValidPullPolicies is the set of pull policies that this package considers valid
	ValidPullPolicies = map[api.PullPolicy]struct{}{
		api.PullAlways:       {},
		api.PullIfNotPresent: {},
		api.PullNever:        {},
	}
)

Functions

func PullPolicyFromString

func PullPolicyFromString(ppStr string) (api.PullPolicy, error)

PullPolicyFromString converts a string into an api.PullPolicy. returns an error if the string does not match a pull policy in ValidPullPolicies()

Types

type ErrInvalidPullPolicy

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

ErrInvalidPullPolicy is the error returned when trying to convert an unknown string to an api.PullPolicy

func (ErrInvalidPullPolicy) Error

func (e ErrInvalidPullPolicy) Error() string

Error is the error interface implementation

type FakeSecretGetter

type FakeSecretGetter struct {
	Fn func(string) (*api.Secret, error)
}

FakeSecretGetter is a mock function that can be swapped in for an SecretGetter or (k8s.io/kubernetes/pkg/client/unversioned).SecretsInterface, so you can unit test your code.

func (*FakeSecretGetter) Create

func (f *FakeSecretGetter) Create(secret *api.Secret) (*api.Secret, error)

Create is the interface definition.

func (*FakeSecretGetter) Delete

func (f *FakeSecretGetter) Delete(name string) error

Delete is the interface definition.

func (*FakeSecretGetter) Get

func (f *FakeSecretGetter) Get(name string) (*api.Secret, error)

Get is the interface definition.

func (*FakeSecretGetter) List

func (f *FakeSecretGetter) List(opts api.ListOptions) (*api.SecretList, error)

List is the interface definition.

func (*FakeSecretGetter) Update

func (f *FakeSecretGetter) Update(secret *api.Secret) (*api.Secret, error)

Update is the interface definition.

func (*FakeSecretGetter) Watch

Watch is the interface definition.

type FakeSecretsNamespacer

type FakeSecretsNamespacer struct {
	Fn func(string) client.SecretsInterface
}

FakeSecretsNamespacer is a mock function that can be swapped in for an (k8s.io/kubernetes/pkg/client/unversioned).SecretsNamespacer, so you can unit test you code

func (*FakeSecretsNamespacer) Secrets

func (f *FakeSecretsNamespacer) Secrets(namespace string) client.SecretsInterface

Secrets is the interface definition.

type NamespaceLister

type NamespaceLister interface {
	List(opts api.ListOptions) (*api.NamespaceList, error)
}

NamespaceLister is a (k8s.io/kubernetes/pkg/client/unversioned).NamespaceInterface compatible interface which only has the List function. It's used in places that only need List to make them easier to test and more easily swappable with other implementations (should the need arise).

Example usage:

var nsl NamespaceLister
nsl = kubeClient.Namespaces()

type PodWatcher

type PodWatcher struct {
	Store      cache.StoreToPodLister
	Controller *framework.Controller
}

PodWatcher is a struct which holds the return values of (k8s.io/kubernetes/pkg/controller/framework).NewIndexerInformer together.

func NewPodWatcher

func NewPodWatcher(c *client.Client, ns string) *PodWatcher

NewPodWatcher creates a new BuildPodWatcher useful to list the pods using a cache which gets updated based on the watch func.

type SecretGetter

type SecretGetter interface {
	Get(name string) (*api.Secret, error)
}

SecretGetter is a (k8s.io/kubernetes/pkg/client/unversioned).SecretsInterface compatible interface which only has the Get function. It's used in places that only need Get to make them easier to test and more easily swappable with other implementations (should the need arise).

Jump to

Keyboard shortcuts

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