Documentation
¶
Index ¶
- func GetLocalIP() (string, error)
- func NodeNameFilter(nodeName string) internalinterfaces.TweakListOptionsFunc
- type Client
- type FakeClient
- func (c *FakeClient) GetPod(podns, podname string) (v1.Pod, error)
- func (c *FakeClient) GetPodInfo(podip string) (string, string, string, *metav1.LabelSelector, error)
- func (c *FakeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)
- func (c *FakeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error)
- func (c *FakeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)
- func (c *FakeClient) ListPodIdsWithBinding(podns string, labels map[string]string) ([]aadpodid.AzureIdentity, error)
- func (c *FakeClient) Start(exit <-chan struct{})
- type KubeClient
- func (c *KubeClient) GetPod(namespace, name string) (v1.Pod, error)
- func (c *KubeClient) GetPodInfo(podip string) (string, string, string, *metav1.LabelSelector, error)
- func (c *KubeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)
- func (c *KubeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error)
- func (c *KubeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)
- func (c *KubeClient) ListPodIdsWithBinding(podns string, labels map[string]string) ([]aadpodid.AzureIdentity, error)
- func (c *KubeClient) Start(exit <-chan struct{})
- func (c *KubeClient) Sync(exit <-chan struct{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalIP ¶
GetLocalIP returns the non loopback local IP of the host
func NodeNameFilter ¶ added in v1.5.3
func NodeNameFilter(nodeName string) internalinterfaces.TweakListOptionsFunc
NodeNameFilter will tweak the options to include the node name as field selector.
Types ¶
type Client ¶
type Client interface {
// Start just starts any informers required.
Start(<-chan struct{})
// GetPod returns the pod object based on name and namespce
GetPod(namespace, name string) (v1.Pod, error)
// GetPodInfo returns the pod name, namespace & replica set name for a given pod ip
GetPodInfo(podip string) (podns, podname, rsName string, selectors *metav1.LabelSelector, err error)
// ListPodIds pod matching azure identity or nil
ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)
// ListPodIdsWithBinding pod matching azure identity or nil
ListPodIdsWithBinding(podns string, labels map[string]string) ([]aadpodid.AzureIdentity, error)
// GetSecret returns secret the secretRef represents
GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)
// ListPodIdentityExceptions returns list of azurepodidentityexceptions
ListPodIdentityExceptions(namespace string) (*[]aadpodid.AzurePodIdentityException, error)
}
Client api client
func NewFakeClient ¶
NewFakeClient new fake kubernetes api client
type FakeClient ¶
type FakeClient struct {
}
FakeClient implements Interface
func (*FakeClient) GetPod ¶ added in v1.6.0
func (c *FakeClient) GetPod(podns, podname string) (v1.Pod, error)
GetPod returns fake pod object and nil error
func (*FakeClient) GetPodInfo ¶
func (c *FakeClient) GetPodInfo(podip string) (string, string, string, *metav1.LabelSelector, error)
GetPodInfo returns fake pod name, namespace and replicaset
func (*FakeClient) GetSecret ¶
func (c *FakeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)
GetSecret returns secret the secretRef represents
func (*FakeClient) ListPodIdentityExceptions ¶
func (c *FakeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error)
ListPodIdentityExceptions for pod
func (*FakeClient) ListPodIds ¶
func (c *FakeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)
ListPodIds for pod
func (*FakeClient) ListPodIdsWithBinding ¶ added in v1.6.0
func (c *FakeClient) ListPodIdsWithBinding(podns string, labels map[string]string) ([]aadpodid.AzureIdentity, error)
ListPodIdsWithBinding for pod
func (*FakeClient) Start ¶ added in v1.5.3
func (c *FakeClient) Start(exit <-chan struct{})
Start - for starting informer clients in the fake Client
type KubeClient ¶
type KubeClient struct {
// Main Kubernetes client
ClientSet kubernetes.Interface
// Crd client used to access our CRD resources.
CrdClient *crd.Client
PodInformer cache.SharedIndexInformer
// contains filtered or unexported fields
}
KubeClient k8s client
func (*KubeClient) GetPod ¶ added in v1.6.0
func (c *KubeClient) GetPod(namespace, name string) (v1.Pod, error)
GetPod returns pod that matches namespace and name
func (*KubeClient) GetPodInfo ¶
func (c *KubeClient) GetPodInfo(podip string) (string, string, string, *metav1.LabelSelector, error)
GetPodInfo get pod ns,name from apiserver
func (*KubeClient) GetSecret ¶
func (c *KubeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)
GetSecret returns secret the secretRef represents
func (*KubeClient) ListPodIdentityExceptions ¶
func (c *KubeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error)
ListPodIdentityExceptions lists azurepodidentityexceptions
func (*KubeClient) ListPodIds ¶
func (c *KubeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)
ListPodIds lists matching ids for pod or error
func (*KubeClient) ListPodIdsWithBinding ¶ added in v1.6.0
func (c *KubeClient) ListPodIdsWithBinding(podns string, labels map[string]string) ([]aadpodid.AzureIdentity, error)
ListPodIdsWithBinding list matching ids for pod based on the bindings
func (*KubeClient) Start ¶ added in v1.5.3
func (c *KubeClient) Start(exit <-chan struct{})
Start the corresponding starts
func (*KubeClient) Sync ¶ added in v1.5.3
func (c *KubeClient) Sync(exit <-chan struct{})
Sync syncs the cache from the K8s client.