Documentation
¶
Index ¶
- Variables
- func ContainerPortToServicePort(containerPort corev1.ContainerPort) corev1.ServicePort
- func ConvertSingleContainerVolumes(scvs []SingleContainerVolume) ([]corev1.Volume, []corev1.VolumeMount)
- func PrivilegedContainerSecurityContext() *corev1.SecurityContext
- func PrivilegedPodSecurityContext() *corev1.PodSecurityContext
- func RestrictedContainerSecurityContext(uid, gid int64) *corev1.SecurityContext
- func RestrictedPodSecurityContext(uid, gid int64) *corev1.PodSecurityContext
- type Client
- func (c *Client) CreatePVC(ctx *contexts.Context, namespace, pvcName string, size resource.Quantity, ...) (*corev1.PersistentVolumeClaim, error)
- func (c *Client) CreatePod(ctx *contexts.Context, namespace string, pod *corev1.Pod) (*corev1.Pod, error)
- func (c *Client) CreateService(ctx *contexts.Context, namespce string, service *corev1.Service) (*corev1.Service, error)
- func (c *Client) DeletePVC(ctx *contexts.Context, namespace, volumeName string) error
- func (c *Client) DeletePod(ctx *contexts.Context, namespace, name string) error
- func (c *Client) DeleteService(ctx *contexts.Context, namespace, name string) error
- func (c *Client) DoesPVCExist(ctx *contexts.Context, namespace, name string) (doesExist bool, err error)
- func (c *Client) EnsurePVCExists(ctx *contexts.Context, namespace, pvcName string, size resource.Quantity, ...) (*corev1.PersistentVolumeClaim, error)
- func (c *Client) GetEndpoint(ctx *contexts.Context, namespace, name string) (*discoveryv1.EndpointSlice, error)
- func (kc *Client) GetPVC(ctx *contexts.Context, namespace, name string) (*corev1.PersistentVolumeClaim, error)
- func (c *Client) WaitForJobCompletion(ctx *contexts.Context, namespace, name string, opts WaitForJobCompletionOpts) (job *batchv1.Job, err error)
- func (c *Client) WaitForReadyEndpoint(ctx *contexts.Context, namespace, name string, opts WaitForReadyEndpointOpts) (endpoints *discoveryv1.EndpointSlice, err error)
- func (c *Client) WaitForReadyPod(ctx *contexts.Context, namespace, name string, opts WaitForReadyPodOpts) (pod *corev1.Pod, err error)
- func (c *Client) WaitForReadyService(ctx *contexts.Context, namespace, name string, opts WaitForReadyServiceOpts) (service *corev1.Service, err error)
- type ClientInterface
- type CreatePVCOptions
- type MockClientInterface
- func (_m *MockClientInterface) CreatePVC(ctx *contexts.Context, namespace string, pvcName string, ...) (*v1.PersistentVolumeClaim, error)
- func (_m *MockClientInterface) CreatePod(ctx *contexts.Context, namespace string, pod *v1.Pod) (*v1.Pod, error)
- func (_m *MockClientInterface) CreateService(ctx *contexts.Context, namespce string, service *v1.Service) (*v1.Service, error)
- func (_m *MockClientInterface) DeletePVC(ctx *contexts.Context, namespace string, volumeName string) error
- func (_m *MockClientInterface) DeletePod(ctx *contexts.Context, namespace string, name string) error
- func (_m *MockClientInterface) DeleteService(ctx *contexts.Context, namespace string, name string) error
- func (_m *MockClientInterface) DoesPVCExist(ctx *contexts.Context, namespace string, name string) (bool, error)
- func (_m *MockClientInterface) EXPECT() *MockClientInterface_Expecter
- func (_m *MockClientInterface) EnsurePVCExists(ctx *contexts.Context, namespace string, pvcName string, ...) (*v1.PersistentVolumeClaim, error)
- func (_m *MockClientInterface) GetEndpoint(ctx *contexts.Context, namespace string, name string) (*discoveryv1.EndpointSlice, error)
- func (_m *MockClientInterface) GetPVC(ctx *contexts.Context, namespace string, name string) (*v1.PersistentVolumeClaim, error)
- func (_m *MockClientInterface) SetCommonLabels(labels map[string]string)
- func (_m *MockClientInterface) WaitForJobCompletion(ctx *contexts.Context, namespace string, name string, ...) (*batchv1.Job, error)
- func (_m *MockClientInterface) WaitForReadyEndpoint(ctx *contexts.Context, namespace string, name string, ...) (*discoveryv1.EndpointSlice, error)
- func (_m *MockClientInterface) WaitForReadyPod(ctx *contexts.Context, namespace string, name string, opts WaitForReadyPodOpts) (*v1.Pod, error)
- func (_m *MockClientInterface) WaitForReadyService(ctx *contexts.Context, namespace string, name string, ...) (*v1.Service, error)
- type MockClientInterface_CreatePVC_Call
- func (_c *MockClientInterface_CreatePVC_Call) Return(_a0 *v1.PersistentVolumeClaim, _a1 error) *MockClientInterface_CreatePVC_Call
- func (_c *MockClientInterface_CreatePVC_Call) Run(run func(ctx *contexts.Context, namespace string, pvcName string, ...)) *MockClientInterface_CreatePVC_Call
- func (_c *MockClientInterface_CreatePVC_Call) RunAndReturn(...) *MockClientInterface_CreatePVC_Call
- type MockClientInterface_CreatePod_Call
- func (_c *MockClientInterface_CreatePod_Call) Return(_a0 *v1.Pod, _a1 error) *MockClientInterface_CreatePod_Call
- func (_c *MockClientInterface_CreatePod_Call) Run(run func(ctx *contexts.Context, namespace string, pod *v1.Pod)) *MockClientInterface_CreatePod_Call
- func (_c *MockClientInterface_CreatePod_Call) RunAndReturn(run func(*contexts.Context, string, *v1.Pod) (*v1.Pod, error)) *MockClientInterface_CreatePod_Call
- type MockClientInterface_CreateService_Call
- func (_c *MockClientInterface_CreateService_Call) Return(_a0 *v1.Service, _a1 error) *MockClientInterface_CreateService_Call
- func (_c *MockClientInterface_CreateService_Call) Run(run func(ctx *contexts.Context, namespce string, service *v1.Service)) *MockClientInterface_CreateService_Call
- func (_c *MockClientInterface_CreateService_Call) RunAndReturn(run func(*contexts.Context, string, *v1.Service) (*v1.Service, error)) *MockClientInterface_CreateService_Call
- type MockClientInterface_DeletePVC_Call
- func (_c *MockClientInterface_DeletePVC_Call) Return(_a0 error) *MockClientInterface_DeletePVC_Call
- func (_c *MockClientInterface_DeletePVC_Call) Run(run func(ctx *contexts.Context, namespace string, volumeName string)) *MockClientInterface_DeletePVC_Call
- func (_c *MockClientInterface_DeletePVC_Call) RunAndReturn(run func(*contexts.Context, string, string) error) *MockClientInterface_DeletePVC_Call
- type MockClientInterface_DeletePod_Call
- func (_c *MockClientInterface_DeletePod_Call) Return(_a0 error) *MockClientInterface_DeletePod_Call
- func (_c *MockClientInterface_DeletePod_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_DeletePod_Call
- func (_c *MockClientInterface_DeletePod_Call) RunAndReturn(run func(*contexts.Context, string, string) error) *MockClientInterface_DeletePod_Call
- type MockClientInterface_DeleteService_Call
- func (_c *MockClientInterface_DeleteService_Call) Return(_a0 error) *MockClientInterface_DeleteService_Call
- func (_c *MockClientInterface_DeleteService_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_DeleteService_Call
- func (_c *MockClientInterface_DeleteService_Call) RunAndReturn(run func(*contexts.Context, string, string) error) *MockClientInterface_DeleteService_Call
- type MockClientInterface_DoesPVCExist_Call
- func (_c *MockClientInterface_DoesPVCExist_Call) Return(_a0 bool, _a1 error) *MockClientInterface_DoesPVCExist_Call
- func (_c *MockClientInterface_DoesPVCExist_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_DoesPVCExist_Call
- func (_c *MockClientInterface_DoesPVCExist_Call) RunAndReturn(run func(*contexts.Context, string, string) (bool, error)) *MockClientInterface_DoesPVCExist_Call
- type MockClientInterface_EnsurePVCExists_Call
- func (_c *MockClientInterface_EnsurePVCExists_Call) Return(_a0 *v1.PersistentVolumeClaim, _a1 error) *MockClientInterface_EnsurePVCExists_Call
- func (_c *MockClientInterface_EnsurePVCExists_Call) Run(run func(ctx *contexts.Context, namespace string, pvcName string, ...)) *MockClientInterface_EnsurePVCExists_Call
- func (_c *MockClientInterface_EnsurePVCExists_Call) RunAndReturn(...) *MockClientInterface_EnsurePVCExists_Call
- type MockClientInterface_Expecter
- func (_e *MockClientInterface_Expecter) CreatePVC(ctx interface{}, namespace interface{}, pvcName interface{}, size interface{}, ...) *MockClientInterface_CreatePVC_Call
- func (_e *MockClientInterface_Expecter) CreatePod(ctx interface{}, namespace interface{}, pod interface{}) *MockClientInterface_CreatePod_Call
- func (_e *MockClientInterface_Expecter) CreateService(ctx interface{}, namespce interface{}, service interface{}) *MockClientInterface_CreateService_Call
- func (_e *MockClientInterface_Expecter) DeletePVC(ctx interface{}, namespace interface{}, volumeName interface{}) *MockClientInterface_DeletePVC_Call
- func (_e *MockClientInterface_Expecter) DeletePod(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DeletePod_Call
- func (_e *MockClientInterface_Expecter) DeleteService(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DeleteService_Call
- func (_e *MockClientInterface_Expecter) DoesPVCExist(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DoesPVCExist_Call
- func (_e *MockClientInterface_Expecter) EnsurePVCExists(ctx interface{}, namespace interface{}, pvcName interface{}, size interface{}, ...) *MockClientInterface_EnsurePVCExists_Call
- func (_e *MockClientInterface_Expecter) GetEndpoint(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_GetEndpoint_Call
- func (_e *MockClientInterface_Expecter) GetPVC(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_GetPVC_Call
- func (_e *MockClientInterface_Expecter) SetCommonLabels(labels interface{}) *MockClientInterface_SetCommonLabels_Call
- func (_e *MockClientInterface_Expecter) WaitForJobCompletion(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForJobCompletion_Call
- func (_e *MockClientInterface_Expecter) WaitForReadyEndpoint(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyEndpoint_Call
- func (_e *MockClientInterface_Expecter) WaitForReadyPod(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyPod_Call
- func (_e *MockClientInterface_Expecter) WaitForReadyService(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyService_Call
- type MockClientInterface_GetEndpoint_Call
- func (_c *MockClientInterface_GetEndpoint_Call) Return(_a0 *discoveryv1.EndpointSlice, _a1 error) *MockClientInterface_GetEndpoint_Call
- func (_c *MockClientInterface_GetEndpoint_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_GetEndpoint_Call
- func (_c *MockClientInterface_GetEndpoint_Call) RunAndReturn(...) *MockClientInterface_GetEndpoint_Call
- type MockClientInterface_GetPVC_Call
- func (_c *MockClientInterface_GetPVC_Call) Return(_a0 *v1.PersistentVolumeClaim, _a1 error) *MockClientInterface_GetPVC_Call
- func (_c *MockClientInterface_GetPVC_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_GetPVC_Call
- func (_c *MockClientInterface_GetPVC_Call) RunAndReturn(run func(*contexts.Context, string, string) (*v1.PersistentVolumeClaim, error)) *MockClientInterface_GetPVC_Call
- type MockClientInterface_SetCommonLabels_Call
- func (_c *MockClientInterface_SetCommonLabels_Call) Return() *MockClientInterface_SetCommonLabels_Call
- func (_c *MockClientInterface_SetCommonLabels_Call) Run(run func(labels map[string]string)) *MockClientInterface_SetCommonLabels_Call
- func (_c *MockClientInterface_SetCommonLabels_Call) RunAndReturn(run func(map[string]string)) *MockClientInterface_SetCommonLabels_Call
- type MockClientInterface_WaitForJobCompletion_Call
- func (_c *MockClientInterface_WaitForJobCompletion_Call) Return(_a0 *batchv1.Job, _a1 error) *MockClientInterface_WaitForJobCompletion_Call
- func (_c *MockClientInterface_WaitForJobCompletion_Call) Run(run func(ctx *contexts.Context, namespace string, name string, ...)) *MockClientInterface_WaitForJobCompletion_Call
- func (_c *MockClientInterface_WaitForJobCompletion_Call) RunAndReturn(...) *MockClientInterface_WaitForJobCompletion_Call
- type MockClientInterface_WaitForReadyEndpoint_Call
- func (_c *MockClientInterface_WaitForReadyEndpoint_Call) Return(_a0 *discoveryv1.EndpointSlice, _a1 error) *MockClientInterface_WaitForReadyEndpoint_Call
- func (_c *MockClientInterface_WaitForReadyEndpoint_Call) Run(run func(ctx *contexts.Context, namespace string, name string, ...)) *MockClientInterface_WaitForReadyEndpoint_Call
- func (_c *MockClientInterface_WaitForReadyEndpoint_Call) RunAndReturn(...) *MockClientInterface_WaitForReadyEndpoint_Call
- type MockClientInterface_WaitForReadyPod_Call
- func (_c *MockClientInterface_WaitForReadyPod_Call) Return(_a0 *v1.Pod, _a1 error) *MockClientInterface_WaitForReadyPod_Call
- func (_c *MockClientInterface_WaitForReadyPod_Call) Run(...) *MockClientInterface_WaitForReadyPod_Call
- func (_c *MockClientInterface_WaitForReadyPod_Call) RunAndReturn(...) *MockClientInterface_WaitForReadyPod_Call
- type MockClientInterface_WaitForReadyService_Call
- func (_c *MockClientInterface_WaitForReadyService_Call) Return(_a0 *v1.Service, _a1 error) *MockClientInterface_WaitForReadyService_Call
- func (_c *MockClientInterface_WaitForReadyService_Call) Run(run func(ctx *contexts.Context, namespace string, name string, ...)) *MockClientInterface_WaitForReadyService_Call
- func (_c *MockClientInterface_WaitForReadyService_Call) RunAndReturn(...) *MockClientInterface_WaitForReadyService_Call
- type SingleContainerVolume
- type WaitForJobCompletionOpts
- type WaitForReadyEndpointOpts
- type WaitForReadyPodOpts
- type WaitForReadyServiceOpts
Constants ¶
This section is empty.
Variables ¶
var ErrJobFailed = errors.New("job failed")
ErrJobFailed is returned by WaitForJobCompletion when the Job reaches a Failed terminal state. It is distinct from a timeout (the Job never finished) so callers can tell the two apart. It is a plain sentinel (not trace.Errorf) so that errors.Is still matches it through a trace.Wrap.
Functions ¶
func ContainerPortToServicePort ¶
func ContainerPortToServicePort(containerPort corev1.ContainerPort) corev1.ServicePort
func ConvertSingleContainerVolumes ¶ added in v0.0.6
func ConvertSingleContainerVolumes(scvs []SingleContainerVolume) ([]corev1.Volume, []corev1.VolumeMount)
TODO replace this with a new, more generic approach Converts SCVs into k8s volumes and volume mounts. If multiple SCVs have the same name, they are merged. This prevents issues with certain CSIs that don't support the same volume being listed multiple times under different names.
func PrivilegedContainerSecurityContext ¶
func PrivilegedContainerSecurityContext() *corev1.SecurityContext
func PrivilegedPodSecurityContext ¶
func PrivilegedPodSecurityContext() *corev1.PodSecurityContext
func RestrictedContainerSecurityContext ¶
func RestrictedContainerSecurityContext(uid, gid int64) *corev1.SecurityContext
func RestrictedPodSecurityContext ¶
func RestrictedPodSecurityContext(uid, gid int64) *corev1.PodSecurityContext
Types ¶
type Client ¶
type Client struct {
helpers.SimpleResourceLabeler
// contains filtered or unexported fields
}
func (*Client) CreatePVC ¶
func (c *Client) CreatePVC(ctx *contexts.Context, namespace, pvcName string, size resource.Quantity, opts CreatePVCOptions) (*corev1.PersistentVolumeClaim, error)
func (*Client) CreateService ¶
func (*Client) DeleteService ¶
func (*Client) DoesPVCExist ¶
func (*Client) EnsurePVCExists ¶
func (c *Client) EnsurePVCExists(ctx *contexts.Context, namespace, pvcName string, size resource.Quantity, opts CreatePVCOptions) (*corev1.PersistentVolumeClaim, error)
func (*Client) GetEndpoint ¶
func (c *Client) GetEndpoint(ctx *contexts.Context, namespace, name string) (*discoveryv1.EndpointSlice, error)
func (*Client) WaitForJobCompletion ¶ added in v0.0.13
func (c *Client) WaitForJobCompletion(ctx *contexts.Context, namespace, name string, opts WaitForJobCompletionOpts) (job *batchv1.Job, err error)
WaitForJobCompletion watches (rather than polls) for a Job to complete, returning it once it does. If the Job reaches a Failed terminal state instead, it returns ErrJobFailed; if it never finishes, it returns a timeout error. The Job is selected by name, or by opts.LabelSelector when its name isn't known ahead of time. A failed Job is reported even if it is subsequently garbage collected, since the delete watch event still carries the Job's final state.
func (*Client) WaitForReadyEndpoint ¶
func (c *Client) WaitForReadyEndpoint(ctx *contexts.Context, namespace, name string, opts WaitForReadyEndpointOpts) (endpoints *discoveryv1.EndpointSlice, err error)
Wait for at least one ready endpoint to be available.
func (*Client) WaitForReadyPod ¶
func (*Client) WaitForReadyService ¶
type ClientInterface ¶
type ClientInterface interface {
helpers.ResourceLabeler
// Pods
CreatePod(ctx *contexts.Context, namespace string, pod *corev1.Pod) (*corev1.Pod, error) // TODO see if this can be refined further
WaitForReadyPod(ctx *contexts.Context, namespace, name string, opts WaitForReadyPodOpts) (*corev1.Pod, error)
DeletePod(ctx *contexts.Context, namespace, name string) error
// Jobs
WaitForJobCompletion(ctx *contexts.Context, namespace, name string, opts WaitForJobCompletionOpts) (*batchv1.Job, error)
// PVCs
CreatePVC(ctx *contexts.Context, namespace, pvcName string, size resource.Quantity, opts CreatePVCOptions) (*corev1.PersistentVolumeClaim, error)
GetPVC(ctx *contexts.Context, namespace, name string) (*corev1.PersistentVolumeClaim, error)
DoesPVCExist(ctx *contexts.Context, namespace, name string) (bool, error)
EnsurePVCExists(ctx *contexts.Context, namespace, pvcName string, size resource.Quantity, opts CreatePVCOptions) (*corev1.PersistentVolumeClaim, error)
DeletePVC(ctx *contexts.Context, namespace, volumeName string) error
// Services
CreateService(ctx *contexts.Context, namespce string, service *corev1.Service) (*corev1.Service, error)
WaitForReadyService(ctx *contexts.Context, namespace, name string, opts WaitForReadyServiceOpts) (*corev1.Service, error)
DeleteService(ctx *contexts.Context, namespace, name string) error
// Endpoints
GetEndpoint(ctx *contexts.Context, namespace, name string) (*discoveryv1.EndpointSlice, error)
WaitForReadyEndpoint(ctx *contexts.Context, namespace, name string, opts WaitForReadyEndpointOpts) (*discoveryv1.EndpointSlice, error)
}
type CreatePVCOptions ¶
type CreatePVCOptions struct {
helpers.GenerateName
StorageClassName string
Source *corev1.TypedObjectReference
}
type MockClientInterface ¶
MockClientInterface is an autogenerated mock type for the ClientInterface type
func NewMockClientInterface ¶
func NewMockClientInterface(t interface {
mock.TestingT
Cleanup(func())
}) *MockClientInterface
NewMockClientInterface creates a new instance of MockClientInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockClientInterface) CreatePVC ¶
func (_m *MockClientInterface) CreatePVC(ctx *contexts.Context, namespace string, pvcName string, size resource.Quantity, opts CreatePVCOptions) (*v1.PersistentVolumeClaim, error)
CreatePVC provides a mock function with given fields: ctx, namespace, pvcName, size, opts
func (*MockClientInterface) CreatePod ¶
func (_m *MockClientInterface) CreatePod(ctx *contexts.Context, namespace string, pod *v1.Pod) (*v1.Pod, error)
CreatePod provides a mock function with given fields: ctx, namespace, pod
func (*MockClientInterface) CreateService ¶
func (_m *MockClientInterface) CreateService(ctx *contexts.Context, namespce string, service *v1.Service) (*v1.Service, error)
CreateService provides a mock function with given fields: ctx, namespce, service
func (*MockClientInterface) DeletePVC ¶
func (_m *MockClientInterface) DeletePVC(ctx *contexts.Context, namespace string, volumeName string) error
DeletePVC provides a mock function with given fields: ctx, namespace, volumeName
func (*MockClientInterface) DeletePod ¶
func (_m *MockClientInterface) DeletePod(ctx *contexts.Context, namespace string, name string) error
DeletePod provides a mock function with given fields: ctx, namespace, name
func (*MockClientInterface) DeleteService ¶
func (_m *MockClientInterface) DeleteService(ctx *contexts.Context, namespace string, name string) error
DeleteService provides a mock function with given fields: ctx, namespace, name
func (*MockClientInterface) DoesPVCExist ¶
func (_m *MockClientInterface) DoesPVCExist(ctx *contexts.Context, namespace string, name string) (bool, error)
DoesPVCExist provides a mock function with given fields: ctx, namespace, name
func (*MockClientInterface) EXPECT ¶
func (_m *MockClientInterface) EXPECT() *MockClientInterface_Expecter
func (*MockClientInterface) EnsurePVCExists ¶
func (_m *MockClientInterface) EnsurePVCExists(ctx *contexts.Context, namespace string, pvcName string, size resource.Quantity, opts CreatePVCOptions) (*v1.PersistentVolumeClaim, error)
EnsurePVCExists provides a mock function with given fields: ctx, namespace, pvcName, size, opts
func (*MockClientInterface) GetEndpoint ¶
func (_m *MockClientInterface) GetEndpoint(ctx *contexts.Context, namespace string, name string) (*discoveryv1.EndpointSlice, error)
GetEndpoint provides a mock function with given fields: ctx, namespace, name
func (*MockClientInterface) GetPVC ¶
func (_m *MockClientInterface) GetPVC(ctx *contexts.Context, namespace string, name string) (*v1.PersistentVolumeClaim, error)
GetPVC provides a mock function with given fields: ctx, namespace, name
func (*MockClientInterface) SetCommonLabels ¶ added in v0.0.9
func (_m *MockClientInterface) SetCommonLabels(labels map[string]string)
SetCommonLabels provides a mock function with given fields: labels
func (*MockClientInterface) WaitForJobCompletion ¶ added in v0.0.13
func (_m *MockClientInterface) WaitForJobCompletion(ctx *contexts.Context, namespace string, name string, opts WaitForJobCompletionOpts) (*batchv1.Job, error)
WaitForJobCompletion provides a mock function with given fields: ctx, namespace, name, opts
func (*MockClientInterface) WaitForReadyEndpoint ¶
func (_m *MockClientInterface) WaitForReadyEndpoint(ctx *contexts.Context, namespace string, name string, opts WaitForReadyEndpointOpts) (*discoveryv1.EndpointSlice, error)
WaitForReadyEndpoint provides a mock function with given fields: ctx, namespace, name, opts
func (*MockClientInterface) WaitForReadyPod ¶
func (_m *MockClientInterface) WaitForReadyPod(ctx *contexts.Context, namespace string, name string, opts WaitForReadyPodOpts) (*v1.Pod, error)
WaitForReadyPod provides a mock function with given fields: ctx, namespace, name, opts
func (*MockClientInterface) WaitForReadyService ¶
func (_m *MockClientInterface) WaitForReadyService(ctx *contexts.Context, namespace string, name string, opts WaitForReadyServiceOpts) (*v1.Service, error)
WaitForReadyService provides a mock function with given fields: ctx, namespace, name, opts
type MockClientInterface_CreatePVC_Call ¶
MockClientInterface_CreatePVC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePVC'
func (*MockClientInterface_CreatePVC_Call) Return ¶
func (_c *MockClientInterface_CreatePVC_Call) Return(_a0 *v1.PersistentVolumeClaim, _a1 error) *MockClientInterface_CreatePVC_Call
func (*MockClientInterface_CreatePVC_Call) Run ¶
func (_c *MockClientInterface_CreatePVC_Call) Run(run func(ctx *contexts.Context, namespace string, pvcName string, size resource.Quantity, opts CreatePVCOptions)) *MockClientInterface_CreatePVC_Call
func (*MockClientInterface_CreatePVC_Call) RunAndReturn ¶
func (_c *MockClientInterface_CreatePVC_Call) RunAndReturn(run func(*contexts.Context, string, string, resource.Quantity, CreatePVCOptions) (*v1.PersistentVolumeClaim, error)) *MockClientInterface_CreatePVC_Call
type MockClientInterface_CreatePod_Call ¶
MockClientInterface_CreatePod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePod'
func (*MockClientInterface_CreatePod_Call) Return ¶
func (_c *MockClientInterface_CreatePod_Call) Return(_a0 *v1.Pod, _a1 error) *MockClientInterface_CreatePod_Call
func (*MockClientInterface_CreatePod_Call) Run ¶
func (_c *MockClientInterface_CreatePod_Call) Run(run func(ctx *contexts.Context, namespace string, pod *v1.Pod)) *MockClientInterface_CreatePod_Call
func (*MockClientInterface_CreatePod_Call) RunAndReturn ¶
func (_c *MockClientInterface_CreatePod_Call) RunAndReturn(run func(*contexts.Context, string, *v1.Pod) (*v1.Pod, error)) *MockClientInterface_CreatePod_Call
type MockClientInterface_CreateService_Call ¶
MockClientInterface_CreateService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateService'
func (*MockClientInterface_CreateService_Call) Return ¶
func (_c *MockClientInterface_CreateService_Call) Return(_a0 *v1.Service, _a1 error) *MockClientInterface_CreateService_Call
func (*MockClientInterface_CreateService_Call) Run ¶
func (_c *MockClientInterface_CreateService_Call) Run(run func(ctx *contexts.Context, namespce string, service *v1.Service)) *MockClientInterface_CreateService_Call
func (*MockClientInterface_CreateService_Call) RunAndReturn ¶
func (_c *MockClientInterface_CreateService_Call) RunAndReturn(run func(*contexts.Context, string, *v1.Service) (*v1.Service, error)) *MockClientInterface_CreateService_Call
type MockClientInterface_DeletePVC_Call ¶
MockClientInterface_DeletePVC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePVC'
func (*MockClientInterface_DeletePVC_Call) Return ¶
func (_c *MockClientInterface_DeletePVC_Call) Return(_a0 error) *MockClientInterface_DeletePVC_Call
func (*MockClientInterface_DeletePVC_Call) Run ¶
func (_c *MockClientInterface_DeletePVC_Call) Run(run func(ctx *contexts.Context, namespace string, volumeName string)) *MockClientInterface_DeletePVC_Call
func (*MockClientInterface_DeletePVC_Call) RunAndReturn ¶
func (_c *MockClientInterface_DeletePVC_Call) RunAndReturn(run func(*contexts.Context, string, string) error) *MockClientInterface_DeletePVC_Call
type MockClientInterface_DeletePod_Call ¶
MockClientInterface_DeletePod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePod'
func (*MockClientInterface_DeletePod_Call) Return ¶
func (_c *MockClientInterface_DeletePod_Call) Return(_a0 error) *MockClientInterface_DeletePod_Call
func (*MockClientInterface_DeletePod_Call) Run ¶
func (_c *MockClientInterface_DeletePod_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_DeletePod_Call
func (*MockClientInterface_DeletePod_Call) RunAndReturn ¶
func (_c *MockClientInterface_DeletePod_Call) RunAndReturn(run func(*contexts.Context, string, string) error) *MockClientInterface_DeletePod_Call
type MockClientInterface_DeleteService_Call ¶
MockClientInterface_DeleteService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteService'
func (*MockClientInterface_DeleteService_Call) Return ¶
func (_c *MockClientInterface_DeleteService_Call) Return(_a0 error) *MockClientInterface_DeleteService_Call
func (*MockClientInterface_DeleteService_Call) Run ¶
func (_c *MockClientInterface_DeleteService_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_DeleteService_Call
func (*MockClientInterface_DeleteService_Call) RunAndReturn ¶
func (_c *MockClientInterface_DeleteService_Call) RunAndReturn(run func(*contexts.Context, string, string) error) *MockClientInterface_DeleteService_Call
type MockClientInterface_DoesPVCExist_Call ¶
MockClientInterface_DoesPVCExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoesPVCExist'
func (*MockClientInterface_DoesPVCExist_Call) Return ¶
func (_c *MockClientInterface_DoesPVCExist_Call) Return(_a0 bool, _a1 error) *MockClientInterface_DoesPVCExist_Call
func (*MockClientInterface_DoesPVCExist_Call) Run ¶
func (_c *MockClientInterface_DoesPVCExist_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_DoesPVCExist_Call
func (*MockClientInterface_DoesPVCExist_Call) RunAndReturn ¶
func (_c *MockClientInterface_DoesPVCExist_Call) RunAndReturn(run func(*contexts.Context, string, string) (bool, error)) *MockClientInterface_DoesPVCExist_Call
type MockClientInterface_EnsurePVCExists_Call ¶
MockClientInterface_EnsurePVCExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsurePVCExists'
func (*MockClientInterface_EnsurePVCExists_Call) Return ¶
func (_c *MockClientInterface_EnsurePVCExists_Call) Return(_a0 *v1.PersistentVolumeClaim, _a1 error) *MockClientInterface_EnsurePVCExists_Call
func (*MockClientInterface_EnsurePVCExists_Call) Run ¶
func (_c *MockClientInterface_EnsurePVCExists_Call) Run(run func(ctx *contexts.Context, namespace string, pvcName string, size resource.Quantity, opts CreatePVCOptions)) *MockClientInterface_EnsurePVCExists_Call
func (*MockClientInterface_EnsurePVCExists_Call) RunAndReturn ¶
func (_c *MockClientInterface_EnsurePVCExists_Call) RunAndReturn(run func(*contexts.Context, string, string, resource.Quantity, CreatePVCOptions) (*v1.PersistentVolumeClaim, error)) *MockClientInterface_EnsurePVCExists_Call
type MockClientInterface_Expecter ¶
type MockClientInterface_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClientInterface_Expecter) CreatePVC ¶
func (_e *MockClientInterface_Expecter) CreatePVC(ctx interface{}, namespace interface{}, pvcName interface{}, size interface{}, opts interface{}) *MockClientInterface_CreatePVC_Call
CreatePVC is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- pvcName string
- size resource.Quantity
- opts CreatePVCOptions
func (*MockClientInterface_Expecter) CreatePod ¶
func (_e *MockClientInterface_Expecter) CreatePod(ctx interface{}, namespace interface{}, pod interface{}) *MockClientInterface_CreatePod_Call
CreatePod is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- pod *v1.Pod
func (*MockClientInterface_Expecter) CreateService ¶
func (_e *MockClientInterface_Expecter) CreateService(ctx interface{}, namespce interface{}, service interface{}) *MockClientInterface_CreateService_Call
CreateService is a helper method to define mock.On call
- ctx *contexts.Context
- namespce string
- service *v1.Service
func (*MockClientInterface_Expecter) DeletePVC ¶
func (_e *MockClientInterface_Expecter) DeletePVC(ctx interface{}, namespace interface{}, volumeName interface{}) *MockClientInterface_DeletePVC_Call
DeletePVC is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- volumeName string
func (*MockClientInterface_Expecter) DeletePod ¶
func (_e *MockClientInterface_Expecter) DeletePod(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DeletePod_Call
DeletePod is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
func (*MockClientInterface_Expecter) DeleteService ¶
func (_e *MockClientInterface_Expecter) DeleteService(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DeleteService_Call
DeleteService is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
func (*MockClientInterface_Expecter) DoesPVCExist ¶
func (_e *MockClientInterface_Expecter) DoesPVCExist(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DoesPVCExist_Call
DoesPVCExist is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
func (*MockClientInterface_Expecter) EnsurePVCExists ¶
func (_e *MockClientInterface_Expecter) EnsurePVCExists(ctx interface{}, namespace interface{}, pvcName interface{}, size interface{}, opts interface{}) *MockClientInterface_EnsurePVCExists_Call
EnsurePVCExists is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- pvcName string
- size resource.Quantity
- opts CreatePVCOptions
func (*MockClientInterface_Expecter) GetEndpoint ¶
func (_e *MockClientInterface_Expecter) GetEndpoint(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_GetEndpoint_Call
GetEndpoint is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
func (*MockClientInterface_Expecter) GetPVC ¶
func (_e *MockClientInterface_Expecter) GetPVC(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_GetPVC_Call
GetPVC is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
func (*MockClientInterface_Expecter) SetCommonLabels ¶ added in v0.0.9
func (_e *MockClientInterface_Expecter) SetCommonLabels(labels interface{}) *MockClientInterface_SetCommonLabels_Call
SetCommonLabels is a helper method to define mock.On call
- labels map[string]string
func (*MockClientInterface_Expecter) WaitForJobCompletion ¶ added in v0.0.13
func (_e *MockClientInterface_Expecter) WaitForJobCompletion(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForJobCompletion_Call
WaitForJobCompletion is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
- opts WaitForJobCompletionOpts
func (*MockClientInterface_Expecter) WaitForReadyEndpoint ¶
func (_e *MockClientInterface_Expecter) WaitForReadyEndpoint(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyEndpoint_Call
WaitForReadyEndpoint is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
- opts WaitForReadyEndpointOpts
func (*MockClientInterface_Expecter) WaitForReadyPod ¶
func (_e *MockClientInterface_Expecter) WaitForReadyPod(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyPod_Call
WaitForReadyPod is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
- opts WaitForReadyPodOpts
func (*MockClientInterface_Expecter) WaitForReadyService ¶
func (_e *MockClientInterface_Expecter) WaitForReadyService(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyService_Call
WaitForReadyService is a helper method to define mock.On call
- ctx *contexts.Context
- namespace string
- name string
- opts WaitForReadyServiceOpts
type MockClientInterface_GetEndpoint_Call ¶
MockClientInterface_GetEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEndpoint'
func (*MockClientInterface_GetEndpoint_Call) Return ¶
func (_c *MockClientInterface_GetEndpoint_Call) Return(_a0 *discoveryv1.EndpointSlice, _a1 error) *MockClientInterface_GetEndpoint_Call
func (*MockClientInterface_GetEndpoint_Call) Run ¶
func (_c *MockClientInterface_GetEndpoint_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_GetEndpoint_Call
func (*MockClientInterface_GetEndpoint_Call) RunAndReturn ¶
func (_c *MockClientInterface_GetEndpoint_Call) RunAndReturn(run func(*contexts.Context, string, string) (*discoveryv1.EndpointSlice, error)) *MockClientInterface_GetEndpoint_Call
type MockClientInterface_GetPVC_Call ¶
MockClientInterface_GetPVC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPVC'
func (*MockClientInterface_GetPVC_Call) Return ¶
func (_c *MockClientInterface_GetPVC_Call) Return(_a0 *v1.PersistentVolumeClaim, _a1 error) *MockClientInterface_GetPVC_Call
func (*MockClientInterface_GetPVC_Call) Run ¶
func (_c *MockClientInterface_GetPVC_Call) Run(run func(ctx *contexts.Context, namespace string, name string)) *MockClientInterface_GetPVC_Call
func (*MockClientInterface_GetPVC_Call) RunAndReturn ¶
func (_c *MockClientInterface_GetPVC_Call) RunAndReturn(run func(*contexts.Context, string, string) (*v1.PersistentVolumeClaim, error)) *MockClientInterface_GetPVC_Call
type MockClientInterface_SetCommonLabels_Call ¶ added in v0.0.9
MockClientInterface_SetCommonLabels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCommonLabels'
func (*MockClientInterface_SetCommonLabels_Call) Return ¶ added in v0.0.9
func (_c *MockClientInterface_SetCommonLabels_Call) Return() *MockClientInterface_SetCommonLabels_Call
func (*MockClientInterface_SetCommonLabels_Call) Run ¶ added in v0.0.9
func (_c *MockClientInterface_SetCommonLabels_Call) Run(run func(labels map[string]string)) *MockClientInterface_SetCommonLabels_Call
func (*MockClientInterface_SetCommonLabels_Call) RunAndReturn ¶ added in v0.0.9
func (_c *MockClientInterface_SetCommonLabels_Call) RunAndReturn(run func(map[string]string)) *MockClientInterface_SetCommonLabels_Call
type MockClientInterface_WaitForJobCompletion_Call ¶ added in v0.0.13
MockClientInterface_WaitForJobCompletion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForJobCompletion'
func (*MockClientInterface_WaitForJobCompletion_Call) Return ¶ added in v0.0.13
func (_c *MockClientInterface_WaitForJobCompletion_Call) Return(_a0 *batchv1.Job, _a1 error) *MockClientInterface_WaitForJobCompletion_Call
func (*MockClientInterface_WaitForJobCompletion_Call) Run ¶ added in v0.0.13
func (_c *MockClientInterface_WaitForJobCompletion_Call) Run(run func(ctx *contexts.Context, namespace string, name string, opts WaitForJobCompletionOpts)) *MockClientInterface_WaitForJobCompletion_Call
func (*MockClientInterface_WaitForJobCompletion_Call) RunAndReturn ¶ added in v0.0.13
func (_c *MockClientInterface_WaitForJobCompletion_Call) RunAndReturn(run func(*contexts.Context, string, string, WaitForJobCompletionOpts) (*batchv1.Job, error)) *MockClientInterface_WaitForJobCompletion_Call
type MockClientInterface_WaitForReadyEndpoint_Call ¶
MockClientInterface_WaitForReadyEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForReadyEndpoint'
func (*MockClientInterface_WaitForReadyEndpoint_Call) Return ¶
func (_c *MockClientInterface_WaitForReadyEndpoint_Call) Return(_a0 *discoveryv1.EndpointSlice, _a1 error) *MockClientInterface_WaitForReadyEndpoint_Call
func (*MockClientInterface_WaitForReadyEndpoint_Call) Run ¶
func (_c *MockClientInterface_WaitForReadyEndpoint_Call) Run(run func(ctx *contexts.Context, namespace string, name string, opts WaitForReadyEndpointOpts)) *MockClientInterface_WaitForReadyEndpoint_Call
func (*MockClientInterface_WaitForReadyEndpoint_Call) RunAndReturn ¶
func (_c *MockClientInterface_WaitForReadyEndpoint_Call) RunAndReturn(run func(*contexts.Context, string, string, WaitForReadyEndpointOpts) (*discoveryv1.EndpointSlice, error)) *MockClientInterface_WaitForReadyEndpoint_Call
type MockClientInterface_WaitForReadyPod_Call ¶
MockClientInterface_WaitForReadyPod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForReadyPod'
func (*MockClientInterface_WaitForReadyPod_Call) Return ¶
func (_c *MockClientInterface_WaitForReadyPod_Call) Return(_a0 *v1.Pod, _a1 error) *MockClientInterface_WaitForReadyPod_Call
func (*MockClientInterface_WaitForReadyPod_Call) Run ¶
func (_c *MockClientInterface_WaitForReadyPod_Call) Run(run func(ctx *contexts.Context, namespace string, name string, opts WaitForReadyPodOpts)) *MockClientInterface_WaitForReadyPod_Call
func (*MockClientInterface_WaitForReadyPod_Call) RunAndReturn ¶
func (_c *MockClientInterface_WaitForReadyPod_Call) RunAndReturn(run func(*contexts.Context, string, string, WaitForReadyPodOpts) (*v1.Pod, error)) *MockClientInterface_WaitForReadyPod_Call
type MockClientInterface_WaitForReadyService_Call ¶
MockClientInterface_WaitForReadyService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForReadyService'
func (*MockClientInterface_WaitForReadyService_Call) Return ¶
func (_c *MockClientInterface_WaitForReadyService_Call) Return(_a0 *v1.Service, _a1 error) *MockClientInterface_WaitForReadyService_Call
func (*MockClientInterface_WaitForReadyService_Call) Run ¶
func (_c *MockClientInterface_WaitForReadyService_Call) Run(run func(ctx *contexts.Context, namespace string, name string, opts WaitForReadyServiceOpts)) *MockClientInterface_WaitForReadyService_Call
func (*MockClientInterface_WaitForReadyService_Call) RunAndReturn ¶
func (_c *MockClientInterface_WaitForReadyService_Call) RunAndReturn(run func(*contexts.Context, string, string, WaitForReadyServiceOpts) (*v1.Service, error)) *MockClientInterface_WaitForReadyService_Call
type SingleContainerVolume ¶
type SingleContainerVolume struct {
Name string `yaml:"name" jsonschema:"required"`
MountPaths []string `yaml:"mountPaths" jsonschema:"required"`
VolumeSource corev1.VolumeSource `yaml:"volumeSource" jsonschema:"required"`
}
Helpers Represents a volume that is mounted in a single container.
func NewSingleContainerPVC ¶
func NewSingleContainerPVC(pvcName, mountPath string) SingleContainerVolume
func NewSingleContainerSecret ¶
func NewSingleContainerSecret(secretName, mountPath string, items ...corev1.KeyToPath) SingleContainerVolume
func (*SingleContainerVolume) ToVolume ¶
func (scv *SingleContainerVolume) ToVolume() corev1.Volume
func (*SingleContainerVolume) ToVolumeMounts ¶ added in v0.0.6
func (svc *SingleContainerVolume) ToVolumeMounts() []corev1.VolumeMount
func (*SingleContainerVolume) WithMountPath ¶ added in v0.0.6
func (scv *SingleContainerVolume) WithMountPath(mountPath string) *SingleContainerVolume
type WaitForJobCompletionOpts ¶ added in v0.0.13
type WaitForJobCompletionOpts struct {
helpers.MaxWaitTime
// LabelSelector selects the Job by label instead of by name, for when the Job's name isn't known
// ahead of time (e.g. CNPG's generate-named recovery Jobs). Pass a name argument or set this, not
// both; when set, the name argument is ignored.
LabelSelector string
}
type WaitForReadyEndpointOpts ¶
type WaitForReadyEndpointOpts struct {
helpers.MaxWaitTime
}
type WaitForReadyPodOpts ¶
type WaitForReadyPodOpts struct {
helpers.MaxWaitTime
}
type WaitForReadyServiceOpts ¶
type WaitForReadyServiceOpts struct {
helpers.MaxWaitTime
}