Documentation ¶
Overview ¶
Package fake implements various fake KubeClients for use in testing
Index ¶
- type FailingKubeClient
- func (f *FailingKubeClient) Build(r io.Reader, _ bool) (kube.ResourceList, error)
- func (f *FailingKubeClient) Create(resources kube.ResourceList) (*kube.Result, error)
- func (f *FailingKubeClient) Delete(resources kube.ResourceList) (*kube.Result, []error)
- func (f *FailingKubeClient) Update(r, modified kube.ResourceList, ignoreMe bool) (*kube.Result, error)
- func (f *FailingKubeClient) Wait(resources kube.ResourceList, d time.Duration) error
- func (f *FailingKubeClient) WaitAndGetCompletedPodPhase(s string, d time.Duration) (v1.PodPhase, error)
- func (f *FailingKubeClient) WaitWithJobs(resources kube.ResourceList, d time.Duration) error
- func (f *FailingKubeClient) WatchUntilReady(resources kube.ResourceList, d time.Duration) error
- type PrintingKubeClient
- func (p *PrintingKubeClient) Build(_ io.Reader, _ bool) (kube.ResourceList, error)
- func (p *PrintingKubeClient) Create(resources kube.ResourceList) (*kube.Result, error)
- func (p *PrintingKubeClient) Delete(resources kube.ResourceList) (*kube.Result, []error)
- func (p *PrintingKubeClient) IsReachable() error
- func (p *PrintingKubeClient) Update(_, modified kube.ResourceList, _ bool) (*kube.Result, error)
- func (p *PrintingKubeClient) Wait(resources kube.ResourceList, _ time.Duration) error
- func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(_ string, _ time.Duration) (v1.PodPhase, error)
- func (p *PrintingKubeClient) WaitWithJobs(resources kube.ResourceList, _ time.Duration) error
- func (p *PrintingKubeClient) WatchUntilReady(resources kube.ResourceList, _ time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailingKubeClient ¶
type FailingKubeClient struct { PrintingKubeClient CreateError error WaitError error DeleteError error WatchUntilReadyError error UpdateError error BuildError error BuildUnstructuredError error WaitAndGetCompletedPodPhaseError error }
FailingKubeClient implements KubeClient for testing purposes. It also has additional errors you can set to fail different functions, otherwise it delegates all its calls to `PrintingKubeClient`
func (*FailingKubeClient) Build ¶
func (f *FailingKubeClient) Build(r io.Reader, _ bool) (kube.ResourceList, error)
Build returns the configured error if set or prints
func (*FailingKubeClient) Create ¶
func (f *FailingKubeClient) Create(resources kube.ResourceList) (*kube.Result, error)
Create returns the configured error if set or prints
func (*FailingKubeClient) Delete ¶
func (f *FailingKubeClient) Delete(resources kube.ResourceList) (*kube.Result, []error)
Delete returns the configured error if set or prints
func (*FailingKubeClient) Update ¶
func (f *FailingKubeClient) Update(r, modified kube.ResourceList, ignoreMe bool) (*kube.Result, error)
Update returns the configured error if set or prints
func (*FailingKubeClient) Wait ¶
func (f *FailingKubeClient) Wait(resources kube.ResourceList, d time.Duration) error
Wait returns the configured error if set or prints
func (*FailingKubeClient) WaitAndGetCompletedPodPhase ¶
func (f *FailingKubeClient) WaitAndGetCompletedPodPhase(s string, d time.Duration) (v1.PodPhase, error)
WaitAndGetCompletedPodPhase returns the configured error if set or prints
func (*FailingKubeClient) WaitWithJobs ¶
func (f *FailingKubeClient) WaitWithJobs(resources kube.ResourceList, d time.Duration) error
WaitWithJobs returns the configured error if set or prints
func (*FailingKubeClient) WatchUntilReady ¶
func (f *FailingKubeClient) WatchUntilReady(resources kube.ResourceList, d time.Duration) error
WatchUntilReady returns the configured error if set or prints
type PrintingKubeClient ¶
PrintingKubeClient implements KubeClient, but simply prints the reader to the given output.
func (*PrintingKubeClient) Build ¶
func (p *PrintingKubeClient) Build(_ io.Reader, _ bool) (kube.ResourceList, error)
Build implements KubeClient Build.
func (*PrintingKubeClient) Create ¶
func (p *PrintingKubeClient) Create(resources kube.ResourceList) (*kube.Result, error)
Create prints the values of what would be created with a real KubeClient.
func (*PrintingKubeClient) Delete ¶
func (p *PrintingKubeClient) Delete(resources kube.ResourceList) (*kube.Result, []error)
Delete implements KubeClient delete.
It only prints out the content to be deleted.
func (*PrintingKubeClient) IsReachable ¶
func (p *PrintingKubeClient) IsReachable() error
IsReachable checks if the cluster is reachable
func (*PrintingKubeClient) Update ¶
func (p *PrintingKubeClient) Update(_, modified kube.ResourceList, _ bool) (*kube.Result, error)
Update implements KubeClient Update.
func (*PrintingKubeClient) Wait ¶
func (p *PrintingKubeClient) Wait(resources kube.ResourceList, _ time.Duration) error
func (*PrintingKubeClient) WaitAndGetCompletedPodPhase ¶
func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(_ string, _ time.Duration) (v1.PodPhase, error)
WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase.
func (*PrintingKubeClient) WaitWithJobs ¶
func (p *PrintingKubeClient) WaitWithJobs(resources kube.ResourceList, _ time.Duration) error
func (*PrintingKubeClient) WatchUntilReady ¶
func (p *PrintingKubeClient) WatchUntilReady(resources kube.ResourceList, _ time.Duration) error
WatchUntilReady implements KubeClient WatchUntilReady.