Documentation ¶
Index ¶
- func NewKubeClient(kc *apiconfig.KubeConfig) (api.Client, error)
- type KubeClient
- func (c *KubeClient) Apply(kvp *model.KVPair) (*model.KVPair, error)
- func (c *KubeClient) Clean() error
- func (c *KubeClient) Create(ctx context.Context, d *model.KVPair) (*model.KVPair, error)
- func (c *KubeClient) Delete(ctx context.Context, k model.Key, revision string) (*model.KVPair, error)
- func (c *KubeClient) EnsureInitialized() error
- func (c *KubeClient) Get(ctx context.Context, k model.Key, revision string) (*model.KVPair, error)
- func (c *KubeClient) List(ctx context.Context, l model.ListInterface, revision string) (*model.KVPairList, error)
- func (c *KubeClient) Syncer(callbacks api.SyncerCallbacks) api.Syncer
- func (c *KubeClient) Update(ctx context.Context, d *model.KVPair) (*model.KVPair, error)
- func (c *KubeClient) Watch(ctx context.Context, l model.ListInterface, revision string) (api.WatchInterface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KubeClient ¶
type KubeClient struct {
// contains filtered or unexported fields
}
func (*KubeClient) Apply ¶
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 ¶
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 ¶
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 ¶
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.