Documentation ¶
Index ¶
- func CreateKubernetesClientset(ca *apiconfig.CalicoAPIConfigSpec) (*rest.Config, *kubernetes.Clientset, error)
- func NewKubeClient(ca *apiconfig.CalicoAPIConfigSpec) (api.Client, error)
- type KubeClient
- func (c *KubeClient) Apply(ctx context.Context, kvp *model.KVPair) (*model.KVPair, error)
- func (c *KubeClient) Clean() error
- func (c *KubeClient) Close() 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) DeleteKVP(ctx context.Context, kvp *model.KVPair) (*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) GetResourceClientFromResourceKind(kind string) resources.K8sResourceClient
- func (c *KubeClient) List(ctx context.Context, l model.ListInterface, revision string) (*model.KVPairList, error)
- 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 ¶
func CreateKubernetesClientset ¶
func CreateKubernetesClientset(ca *apiconfig.CalicoAPIConfigSpec) (*rest.Config, *kubernetes.Clientset, error)
func NewKubeClient ¶
func NewKubeClient(ca *apiconfig.CalicoAPIConfigSpec) (api.Client, error)
Types ¶
type KubeClient ¶
type KubeClient struct { // Main Kubernetes clients. ClientSet *kubernetes.Clientset // 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 by key.
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) GetResourceClientFromResourceKind ¶
func (c *KubeClient) GetResourceClientFromResourceKind(kind string) resources.K8sResourceClient
getResourceClientFromKey returns the appropriate resource client for the v3 resource kind.
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) 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.
Directories ¶
Path | Synopsis |
---|---|
TODO move the WorkloadEndpoint converters to is own package.
|
TODO move the WorkloadEndpoint converters to is own package. |