Documentation ¶
Index ¶
- Constants
- func AssertJSONEqual(t *testing.T, expected, actual interface{})
- func CreateAppReplicaSet(name string) *appsv1.ReplicaSet
- func CreateCRD(name string, options ...CRDOption) *apiextv1beta1.CustomResourceDefinition
- func CreateClusterRole(name string) *rbacv1.ClusterRole
- func CreateClusterRoleBinding(name, roleName string, subjects []rbacv1.Subject) *rbacv1.ClusterRoleBinding
- func CreateConfigMap(name string) *corev1.ConfigMap
- func CreateCronJob(name string) *batchv1beta1.CronJob
- func CreateCustomResource(name string) *unstructured.Unstructured
- func CreateDaemonSet(name string) *appsv1.DaemonSet
- func CreateDeployment(name string, options ...DeploymentOption) *appsv1.Deployment
- func CreateEvent(name string) *corev1.Event
- func CreateExtReplicaSet(name string) *extv1beta1.ReplicaSet
- func CreateHorizontalPodAutoscaler(name string) *autoscalingv1.HorizontalPodAutoscaler
- func CreateIngress(name string) *extv1beta1.Ingress
- func CreateJob(name string) *batchv1.Job
- func CreateNamespace(name string) *corev1.Namespace
- func CreateNode(name string) *corev1.Node
- func CreatePersistentVolumeClaim(name string) *corev1.PersistentVolumeClaim
- func CreatePod(name string, options ...PodOption) *corev1.Pod
- func CreateReplicationController(name string) *corev1.ReplicationController
- func CreateRole(name string) *rbacv1.Role
- func CreateRoleBinding(roleBindingName, roleName string, subjects []rbacv1.Subject) *rbacv1.RoleBinding
- func CreateRoleBindingSubject(kind, name, namespace string) *rbacv1.Subject
- func CreateSecret(name string) *corev1.Secret
- func CreateService(name string) *corev1.Service
- func CreateServiceAccount(name string) *corev1.ServiceAccount
- func CreateStatefulSet(name string) *appsv1.StatefulSet
- func CreateTimestamp() *metav1.Time
- func LoadObjectFromFile(t *testing.T, objectFile string) runtime.Object
- func LoadTypedObjectFromFile(t *testing.T, objectFile string, into runtime.Object)
- func Time() time.Time
- func ToOwnerReferences(t *testing.T, object runtime.Object) []metav1.OwnerReference
- func ToUnstructured(t *testing.T, object runtime.Object) *unstructured.Unstructured
- func ToUnstructuredList(t *testing.T, objects ...runtime.Object) *unstructured.UnstructuredList
- type CRDOption
- type DeploymentOption
- type PodOption
Constants ¶
const DefaultNamespace = "namespace"
DefaultNamespace is the namespace that objects will belong to.
Variables ¶
This section is empty.
Functions ¶
func AssertJSONEqual ¶
AssertJSONEqual asserts two object's generated JSON is equal.
func CreateAppReplicaSet ¶
func CreateAppReplicaSet(name string) *appsv1.ReplicaSet
CreateAppReplicaSet creates a replica set
func CreateCRD ¶
func CreateCRD(name string, options ...CRDOption) *apiextv1beta1.CustomResourceDefinition
CreateCRD creates a CRD
func CreateClusterRole ¶
func CreateClusterRole(name string) *rbacv1.ClusterRole
CreateClusterRole creates a cluster role.
func CreateClusterRoleBinding ¶
func CreateClusterRoleBinding(name, roleName string, subjects []rbacv1.Subject) *rbacv1.ClusterRoleBinding
CreateClusterRoleBinding creates a cluster role binding
func CreateConfigMap ¶
CreateConfigMap creates a config map.
func CreateCronJob ¶
func CreateCronJob(name string) *batchv1beta1.CronJob
func CreateCustomResource ¶
func CreateCustomResource(name string) *unstructured.Unstructured
CreateCustomResource creates a custom resource.
func CreateDaemonSet ¶
CreateDaemonSet creates a daemon set
func CreateDeployment ¶
func CreateDeployment(name string, options ...DeploymentOption) *appsv1.Deployment
CreateDeployment creates a deployment
func CreateExtReplicaSet ¶
func CreateExtReplicaSet(name string) *extv1beta1.ReplicaSet
CreateExtReplicaSet creates a replica set
func CreateHorizontalPodAutoscaler ¶
func CreateHorizontalPodAutoscaler(name string) *autoscalingv1.HorizontalPodAutoscaler
CreateHorizontalPodAutoscaler creates a horizontal pod autoscaler
func CreateIngress ¶
func CreateIngress(name string) *extv1beta1.Ingress
CreateIngress creates an ingress
func CreateNamespace ¶
CreateNode creates a namespace
func CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(name string) *corev1.PersistentVolumeClaim
CreatePersistentVolumeClaim creates a persistent volume claim
func CreateReplicationController ¶
func CreateReplicationController(name string) *corev1.ReplicationController
CreateReplicationController creates a replication controller
func CreateRoleBinding ¶
func CreateRoleBinding(roleBindingName, roleName string, subjects []rbacv1.Subject) *rbacv1.RoleBinding
func CreateService ¶
CreateService creates a service
func CreateServiceAccount ¶
func CreateServiceAccount(name string) *corev1.ServiceAccount
CreateServiceAccount creates a service account
func CreateStatefulSet ¶
func CreateStatefulSet(name string) *appsv1.StatefulSet
CreateStatefulSet creates a stateful set
func CreateTimestamp ¶
func LoadObjectFromFile ¶
LoadObjectFromFile loads a file from the `testdata` directory. It will assign it a `default` namespace if one is not set.
func LoadTypedObjectFromFile ¶
LoadTypedObjectFromFile loads a file from the `testdata` directory. It will assign it a `default` namespace if one is not set.
func ToOwnerReferences ¶
ToOwnerReferences converts an object to owner references.
func ToUnstructured ¶
func ToUnstructured(t *testing.T, object runtime.Object) *unstructured.Unstructured
ToUnstructured converts an object to an unstructured.
func ToUnstructuredList ¶
func ToUnstructuredList(t *testing.T, objects ...runtime.Object) *unstructured.UnstructuredList
ToUnstructuredList converts a list of objects to a list of unstructured.
Types ¶
type CRDOption ¶
type CRDOption func(definition *apiextv1beta1.CustomResourceDefinition)
CRDOption is an option for configuring CreateCRD.
func WithGenericCRD ¶
func WithGenericCRD() CRDOption
WithGenericCRD creates a crd with group/kind and one version
type DeploymentOption ¶
type DeploymentOption func(d *appsv1.Deployment)
DeploymentOption is an option for configuration CreateDeployment.
func WithGenericDeployment ¶
func WithGenericDeployment() DeploymentOption