Documentation ¶
Index ¶
- Constants
- func AssertJSONEqual(t *testing.T, expected, actual interface{})
- func CreateAPIService(version, group string) *apiregistrationv1.APIService
- func CreateAppReplicaSet(name string) *appsv1.ReplicaSet
- func CreateCRD(name string, options ...CRDOption) *apiextv1.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, options ...CustomResourceOption) *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 CreateMutatingWebhookConfiguration(name string) *admissionregistrationv1beta1.MutatingWebhookConfiguration
- func CreateNamespace(name string) *corev1.Namespace
- func CreateNetworkPolicy(name string) *networkingv1.NetworkPolicy
- func CreateNode(name string) *corev1.Node
- func CreatePersistentVolume(name string) *corev1.PersistentVolume
- func CreatePersistentVolumeClaim(name string) *corev1.PersistentVolumeClaim
- func CreatePod(name string, options ...PodOption) *corev1.Pod
- func CreatePodMetrics(name string, options ...PodMetricOption) *metricsv1beta1.PodMetrics
- 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, options ...func(*corev1.Secret)) *corev1.Secret
- func CreateService(name string) *corev1.Service
- func CreateServiceAccount(name string, options ...func(*corev1.ServiceAccount)) *corev1.ServiceAccount
- func CreateStatefulSet(name string) *appsv1.StatefulSet
- func CreateTimestamp() *metav1.Time
- func CreateValidatingWebhookConfiguration(name string) *admissionregistrationv1beta1.ValidatingWebhookConfiguration
- func LoadObjectFromFile(t *testing.T, objectFile string) runtime.Object
- func LoadTestData(t *testing.T, fileName string) []byte
- func LoadTypedObjectFromFile(t *testing.T, objectFile string, into runtime.Object)
- func LoadUnstructuredFromFile(t *testing.T, objectFile string) *unstructured.Unstructured
- func RequireErrorOrNot(t *testing.T, wantErr bool, err error, fns ...func())
- func Time() time.Time
- func ToOwnerReferences(t *testing.T, objects ...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 CustomResourceOption
- type DeploymentOption
- type PodMetricOption
- 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 CreateAPIService ¶ added in v0.15.0
func CreateAPIService(version, group string) *apiregistrationv1.APIService
func CreateAppReplicaSet ¶
func CreateAppReplicaSet(name string) *appsv1.ReplicaSet
CreateAppReplicaSet creates a replica set
func CreateCRD ¶
func CreateCRD(name string, options ...CRDOption) *apiextv1.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, options ...CustomResourceOption) *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 CreateMutatingWebhookConfiguration ¶ added in v0.15.0
func CreateMutatingWebhookConfiguration(name string) *admissionregistrationv1beta1.MutatingWebhookConfiguration
func CreateNamespace ¶
CreateNamespace creates a namespace
func CreateNetworkPolicy ¶ added in v0.12.0
func CreateNetworkPolicy(name string) *networkingv1.NetworkPolicy
CreateNetworkPolicy creates a network policy
func CreatePersistentVolume ¶ added in v0.11.0
func CreatePersistentVolume(name string) *corev1.PersistentVolume
CreatePersistentVolume creates a persistent volume
func CreatePersistentVolumeClaim ¶
func CreatePersistentVolumeClaim(name string) *corev1.PersistentVolumeClaim
CreatePersistentVolumeClaim creates a persistent volume claim
func CreatePodMetrics ¶ added in v0.10.0
func CreatePodMetrics(name string, options ...PodMetricOption) *metricsv1beta1.PodMetrics
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 CreateSecret ¶
CreateSecret creates a secret
func CreateService ¶
CreateService creates a service
func CreateServiceAccount ¶
func CreateServiceAccount(name string, options ...func(*corev1.ServiceAccount)) *corev1.ServiceAccount
CreateServiceAccount creates a service account
func CreateStatefulSet ¶
func CreateStatefulSet(name string) *appsv1.StatefulSet
CreateStatefulSet creates a stateful set
func CreateTimestamp ¶
func CreateValidatingWebhookConfiguration ¶ added in v0.15.0
func CreateValidatingWebhookConfiguration(name string) *admissionregistrationv1beta1.ValidatingWebhookConfiguration
func LoadObjectFromFile ¶
LoadObjectFromFile loads a file from the `testdata` directory. It will assign it a `default` namespace if one is not set.
func LoadTestData ¶ added in v0.13.0
LoadTestData loads a file in the testdata directory.
func LoadTypedObjectFromFile ¶
LoadTypedObjectFromFile loads a file from the `testdata` directory. It will assign it a `default` namespace if one is not set.
func LoadUnstructuredFromFile ¶ added in v0.10.0
func LoadUnstructuredFromFile(t *testing.T, objectFile string) *unstructured.Unstructured
LoadUnstructuredFromFile loads an object from a file in the in `testdata` directory. It will assign a `default` namespace if one is not set. This helper does not support multiple objects in a YAML file.
func RequireErrorOrNot ¶ added in v0.10.0
RequireErrorOrNot or not is a helper that requires an error or not. If functions are present, execute them if there was no error.
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 *apiextv1.CustomResourceDefinition)
CRDOption is an option for configuring CreateCRD.
func WithGenericCRD ¶
func WithGenericCRD() CRDOption
WithGenericCRD creates a crd with group/kind and one version
type CustomResourceOption ¶ added in v0.15.0
type CustomResourceOption func(u *unstructured.Unstructured)
CustomResourceOption is an option for configuring CreateCustomResource.
type DeploymentOption ¶
type DeploymentOption func(d *appsv1.Deployment)
DeploymentOption is an option for configuration CreateDeployment.
func WithGenericDeployment ¶
func WithGenericDeployment() DeploymentOption
type PodMetricOption ¶ added in v0.10.0
type PodMetricOption func(metrics *metricsv1beta1.PodMetrics)