k8s

package
v2.0.0-alpha1+incompat... Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 23 Imported by: 67

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKubeClient

func NewKubeClient(kc *apiconfig.KubeConfig) (api.Client, error)

Types

type KubeClient

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

func (*KubeClient) Apply

func (c *KubeClient) Apply(kvp *model.KVPair) (*model.KVPair, error)

Set an existing entry in the datastore. This ignores whether an entry already exists. This is not exposed in the main client - but we keep here for the backend API.

func (*KubeClient) Clean

func (c *KubeClient) Clean() error

Remove Calico-creatable data from the datastore. This is purely used for the test framework.

func (*KubeClient) Create

func (c *KubeClient) Create(ctx context.Context, d *model.KVPair) (*model.KVPair, error)

Create an entry in the datastore. This errors if the entry already exists.

func (*KubeClient) Delete

func (c *KubeClient) Delete(ctx context.Context, k model.Key, revision string) (*model.KVPair, error)

Delete an entry in the datastore. This is a no-op when using the k8s backend.

func (*KubeClient) EnsureInitialized

func (c *KubeClient) EnsureInitialized() error

EnsureInitialized checks that the necessary custom resource definitions exist in the backend. This usually passes when using etcd as a backend but can often fail when using KDD as it relies on various custom resources existing. To ensure the datastore is initialized, this function checks that a known custom resource is defined: GlobalFelixConfig. It accomplishes this by trying to set the ClusterType (an instance of GlobalFelixConfig).

func (*KubeClient) Get

func (c *KubeClient) Get(ctx context.Context, k model.Key, revision string) (*model.KVPair, error)

Get an entry from the datastore. This errors if the entry does not exist.

func (*KubeClient) List

func (c *KubeClient) List(ctx context.Context, l model.ListInterface, revision string) (*model.KVPairList, error)

List entries in the datastore. This may return an empty list if there are no entries matching the request in the ListInterface.

func (*KubeClient) Syncer

func (c *KubeClient) Syncer(callbacks api.SyncerCallbacks) api.Syncer

Syncer returns a v1 Syncer used to stream resource updates.

func (*KubeClient) Update

func (c *KubeClient) Update(ctx context.Context, d *model.KVPair) (*model.KVPair, error)

Update an existing entry in the datastore. This errors if the entry does not exist.

func (*KubeClient) Watch

func (c *KubeClient) Watch(ctx context.Context, l model.ListInterface, revision string) (api.WatchInterface, error)

List entries in the datastore. This may return an empty list if there are no entries matching the request in the ListInterface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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