Documentation ¶
Index ¶
- type Client
- type Finalizer
- type MockClient
- func (c *MockClient) Create(object sdk.Object) error
- func (c *MockClient) Get(into sdk.Object, opts ...sdk.GetOption) error
- func (c *MockClient) List(namespace string, into sdk.Object, opts ...sdk.ListOption) error
- func (c *MockClient) Patch(object sdk.Object, pt types.PatchType, patch []byte) error
- func (c *MockClient) Run(pod *corev1.Pod, containerIdx int, command []string) (string, string, error)
- func (c *MockClient) Update(object sdk.Object) error
- type OperatorSdkClient
- func (c *OperatorSdkClient) Create(object sdk.Object) error
- func (c *OperatorSdkClient) Get(into sdk.Object, opts ...sdk.GetOption) error
- func (c *OperatorSdkClient) List(namespace string, into sdk.Object, opts ...sdk.ListOption) error
- func (c *OperatorSdkClient) Patch(object sdk.Object, pt types.PatchType, patch []byte) error
- func (c *OperatorSdkClient) Run(pod *corev1.Pod, containerIdx int, command []string) (string, string, error)
- func (c *OperatorSdkClient) Update(object sdk.Object) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Get(into sdk.Object, opts ...sdk.GetOption) error List(namespace string, into sdk.Object, opts ...sdk.ListOption) error Create(object sdk.Object) error Update(object sdk.Object) error Run(pod *corev1.Pod, containerIdx int, command []string) (string, string, error) Patch(object sdk.Object, pt types.PatchType, patch []byte) (err error) }
Client is currently an interface because this code should be totally replaced once the refactors of the operator-sdk is complete
type Finalizer ¶
type Finalizer struct {
// contains filtered or unexported fields
}
Finalizer manages the finalizers for resources in kubernetes
func NewFinalizer ¶
NewFinalizer constructs a new finalizer manager
func (*Finalizer) IsDeletionCandidate ¶
IsDeletionCandidate checks if the resource is a candidate for deletion
type MockClient ¶
type MockClient struct { RunStdOut string RunStdErr string RunErr error PatchCallback func(object sdk.Object, pt types.PatchType, patch []byte) error GetCallback func(into sdk.Object, opts ...sdk.GetOption) error CreateCallback func(object sdk.Object) error UpdateCallback func(object sdk.Object) error ListCallback func(namespace string, into sdk.Object, opts ...sdk.ListOption) error RunCallback func(pod *corev1.Pod, containerIdx int, command []string) (string, string, error) }
MockClient implements a Mock of the sdk client
func (*MockClient) Create ¶
func (c *MockClient) Create(object sdk.Object) error
Create returns mock value
func (*MockClient) List ¶
func (c *MockClient) List(namespace string, into sdk.Object, opts ...sdk.ListOption) error
List returns mock values
type OperatorSdkClient ¶
type OperatorSdkClient struct {
// contains filtered or unexported fields
}
OperatorSdkClient is a class that allows for the operator-sdk to be injected for unit testing purposes
func NewOperatorSdkClient ¶
func NewOperatorSdkClient() *OperatorSdkClient
NewOperatorSdkClient returns a new client for interacting with the operator-sdk/kubernetes
func (*OperatorSdkClient) Create ¶
func (c *OperatorSdkClient) Create(object sdk.Object) error
Create resource in kube
func (*OperatorSdkClient) List ¶
func (c *OperatorSdkClient) List(namespace string, into sdk.Object, opts ...sdk.ListOption) error
List resources from kube