github.com/Azure/aad-pod-identity@v1.8.17/pkg/k8s/fake.go (about) 1 package k8s 2 3 import ( 4 aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity" 5 6 v1 "k8s.io/api/core/v1" 7 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 8 ) 9 10 // FakeClient implements Interface 11 type FakeClient struct { 12 } 13 14 // NewFakeClient new fake kubernetes api client 15 func NewFakeClient() (Client, error) { 16 17 fakeClient := &FakeClient{} 18 19 return fakeClient, nil 20 } 21 22 // GetPodInfo returns fake pod name, namespace and replicaset 23 func (c *FakeClient) GetPodInfo(podip string) (string, string, string, *metav1.LabelSelector, error) { 24 return "ns", "podname", "rsName", nil, nil 25 } 26 27 // GetPod returns fake pod object and nil error 28 func (c *FakeClient) GetPod(podns, podname string) (v1.Pod, error) { 29 return v1.Pod{}, nil 30 } 31 32 // ListPodIds for pod 33 func (c *FakeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error) { 34 return nil, nil 35 } 36 37 // ListPodIdsWithBinding for pod 38 func (c *FakeClient) ListPodIdsWithBinding(podns string, labels map[string]string) ([]aadpodid.AzureIdentity, error) { 39 return nil, nil 40 } 41 42 // ListPodIdentityExceptions for pod 43 func (c *FakeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error) { 44 return nil, nil 45 } 46 47 // GetSecret returns secret the secretRef represents 48 func (c *FakeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error) { 49 return nil, nil 50 } 51 52 // Start - for starting informer clients in the fake Client 53 func (c *FakeClient) Start(exit <-chan struct{}) { 54 55 }