Documentation ¶
Index ¶
- Variables
- func ConfigMap(name string, namespace string, data map[string]string) *corev1.ConfigMap
- func Container(env map[string]string, configmaps, secrets []string) corev1.Container
- func CronJobv1(name, namespace string, env map[string]string, configmaps, secrets []string) *batchv1.CronJob
- func CronJobv1Resource() *metav1.APIResourceList
- func CronJobv1beta1(name, namespace string, env map[string]string, configmaps, secrets []string) *batchv1beta1.CronJob
- func CronJobv1beta1Resource() *metav1.APIResourceList
- func DaemonSet(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.DaemonSet
- func Deployment(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.Deployment
- func InvalidGroupResource() *metav1.APIResourceList
- func Job(name, namespace string, env map[string]string, configmaps, secrets []string) *batchv1.Job
- func Jobv1Resource() *metav1.APIResourceList
- func Namespace(name string) *corev1.Namespace
- func NewFakeResource(groupVersion, name, singularName, kind, group string) *metav1.APIResourceList
- func Pod(name, namespace string, env map[string]string, configmaps, secrets []string) *corev1.Pod
- func ReplicaSet(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.ReplicaSet
- func Secret(name string, namespace string, data map[string][]byte) *corev1.Secret
- func StatefulSet(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.StatefulSet
- func UnsupportedGroupResource() *metav1.APIResourceList
- type Error
- type ErrorWriter
- type FakeClient
- type Writer
Constants ¶
This section is empty.
Variables ¶
var AnError = errors.New("mock.AnError general error for testing") //nolint
AnError is a general error for testing.
var ErrWriter = errors.New("mock error")
ErrWriter is a fixed message returned by `ErrorWriter.Write`.
Functions ¶
func CronJobv1 ¶
func CronJobv1(name, namespace string, env map[string]string, configmaps, secrets []string) *batchv1.CronJob
CronJobv1 returns a mock struct.
func CronJobv1Resource ¶ added in v1.2.0
func CronJobv1Resource() *metav1.APIResourceList
CronJobv1Resource returns a v1 CronJob resource list.
func CronJobv1beta1 ¶
func CronJobv1beta1(name, namespace string, env map[string]string, configmaps, secrets []string) *batchv1beta1.CronJob
CronJobv1beta1 returns a mock struct.
func CronJobv1beta1Resource ¶ added in v1.2.0
func CronJobv1beta1Resource() *metav1.APIResourceList
CronJobv1beta1Resource returns a v1beta1 CronJob resource list.
func DaemonSet ¶
func DaemonSet(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.DaemonSet
DaemonSet returns a mock struct.
func Deployment ¶
func Deployment(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.Deployment
Deployment returns a mock struct.
func InvalidGroupResource ¶ added in v1.2.0
func InvalidGroupResource() *metav1.APIResourceList
InvalidGroupResource returns an `APIResourceList` with an invalid group.
func Jobv1Resource ¶ added in v1.2.0
func Jobv1Resource() *metav1.APIResourceList
Jobv1Resource returns a v1 Job resource list.
func NewFakeResource ¶ added in v1.2.0
func NewFakeResource(groupVersion, name, singularName, kind, group string) *metav1.APIResourceList
NewFakeResource returns an `APIResourceList` to be used with `FakeClient.WithResources`.
func ReplicaSet ¶
func ReplicaSet(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.ReplicaSet
ReplicaSet returns a mock struct.
func StatefulSet ¶ added in v1.3.0
func StatefulSet(name, namespace string, env map[string]string, configmaps, secrets []string) *appsv1.StatefulSet
StatefulSet returns a mock struct.
func UnsupportedGroupResource ¶ added in v1.2.0
func UnsupportedGroupResource() *metav1.APIResourceList
UnsupportedGroupResource returns a resource list with a group version `batch/unsupported`.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is used in tests.
type ErrorWriter ¶ added in v1.2.0
type ErrorWriter struct {
// contains filtered or unexported fields
}
ErrorWriter used in tests.
func NewErrorWriter ¶ added in v1.2.0
func NewErrorWriter() *ErrorWriter
NewErrorWriter creates an io.Writer used in tests.
func (*ErrorWriter) ErrorAfter ¶ added in v1.2.0
func (w *ErrorWriter) ErrorAfter(errorAfter int) io.Writer
ErrorAfter will cause the writer to error after a certain number of writes.
type FakeClient ¶ added in v1.2.0
FakeClient used in tests.
func NewFakeClient ¶ added in v1.2.0
func NewFakeClient(objects ...runtime.Object) *FakeClient
NewFakeClient returns a `FakeClient` with a `fake.ClientSet` internally.
func (*FakeClient) PrependReactor ¶ added in v1.2.0
func (c *FakeClient) PrependReactor(v string, r string, h bool, o runtime.Object, e error) *FakeClient
PrependReactor adds a reactor to the beginning of the chain.
func (*FakeClient) WithResources ¶ added in v1.2.0
func (c *FakeClient) WithResources(resourceList *metav1.APIResourceList) *FakeClient
WithResources adds an `APIResourceList` to a `FakeClient`.