Documentation ¶
Index ¶
- func EnsureCIDR(cidr string) *net.IPNet
- func NewFakePod(name string, netAnnotation string, defaultNetAnnotation string) *v1.Pod
- type FakeKubeClient
- func (f *FakeKubeClient) AddNetConfig(namespace, name, data string)
- func (f *FakeKubeClient) AddNetConfigAnnotation(namespace, name, data string)
- func (f *FakeKubeClient) AddNetFile(namespace, name, filePath, fileData string)
- func (f *FakeKubeClient) AddPod(pod *v1.Pod)
- func (f *FakeKubeClient) DeletePod(pod *v1.Pod)
- func (f *FakeKubeClient) GetPod(namespace, name string) (*v1.Pod, error)
- func (f *FakeKubeClient) GetRawWithPath(path string) ([]byte, error)
- func (f *FakeKubeClient) UpdatePodStatus(pod *v1.Pod) (*v1.Pod, error)
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCIDR ¶
EnsureCIDR parses/verify CIDR ip string and convert to net.IPNet
Types ¶
type FakeKubeClient ¶
FakeKubeClient is stub KubeClient for testing
func NewFakeKubeClient ¶
func NewFakeKubeClient() *FakeKubeClient
NewFakeKubeClient creates FakeKubeClient for testing
func (*FakeKubeClient) AddNetConfig ¶
func (f *FakeKubeClient) AddNetConfig(namespace, name, data string)
AddNetConfig adds net-attach-def into its client
func (*FakeKubeClient) AddNetConfigAnnotation ¶
func (f *FakeKubeClient) AddNetConfigAnnotation(namespace, name, data string)
AddNetConfigAnnotation adds net-attach-def into its client with an annotation
func (*FakeKubeClient) AddNetFile ¶
func (f *FakeKubeClient) AddNetFile(namespace, name, filePath, fileData string)
AddNetFile puts config file as net-attach-def
func (*FakeKubeClient) AddPod ¶
func (f *FakeKubeClient) AddPod(pod *v1.Pod)
AddPod adds pod into fake client
func (*FakeKubeClient) DeletePod ¶
func (f *FakeKubeClient) DeletePod(pod *v1.Pod)
DeletePod remove pod from fake client
func (*FakeKubeClient) GetPod ¶
func (f *FakeKubeClient) GetPod(namespace, name string) (*v1.Pod, error)
GetPod query pod by namespace/pod and return it if exists
func (*FakeKubeClient) GetRawWithPath ¶
func (f *FakeKubeClient) GetRawWithPath(path string) ([]byte, error)
GetRawWithPath returns k8s raw data from its path
func (*FakeKubeClient) UpdatePodStatus ¶
UpdatePodStatus update pod status
type Result ¶
type Result struct { CNIVersion string `json:"cniVersion,omitempty"` IP4 *types020.IPConfig `json:"ip4,omitempty"` IP6 *types020.IPConfig `json:"ip6,omitempty"` DNS types.DNS `json:"dns,omitempty"` }
Result is stub Result for testing
func (*Result) GetAsVersion ¶
GetAsVersion returns a Result object given a version
Click to show internal directories.
Click to hide internal directories.