testutils

package
v0.0.0-...-7938a71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ClusterTokenId string = "12345"

ClusterTokenId represents the part of identifiers which is varied by the installer, eg clustername-clustertokenid, as in load balancer names: foo-12345-us-east-1a

View Source
const DefaultAMIID string = "ami-123456"
View Source
const DefaultAPIEndpoint string = "https://api.unit.test:6443"
View Source
const DefaultAzName string = "us-east-1a"
View Source
const DefaultClusterDomain string = "unit.test"
View Source
const DefaultRegionName string = "us-east-1"

Variables

This section is empty.

Functions

func CreatOldInfraObject

func CreatOldInfraObject(infraName, apiInternalURL, apiURL, region string) *configv1.Infrastructure

CreatOldInfraObject creates an Infrastructure object that is missing information eg for https://bugzilla.redhat.com/show_bug.cgi?id=1814332

func CreateAPISchemeObject

func CreateAPISchemeObject(dnsname string, enabled bool, cidrs []string) *cloudingressv1alpha1.APIScheme

CreateAPISchemeObject makes an APISCheme object

func CreateAPIServerObject

func CreateAPIServerObject(clustername, clusterdomain string) *configv1.APIServer

CreateAPIServerObject creates a configv1.APIServer object

func CreateGCPInfraObject

func CreateGCPInfraObject(infraName, apiInternalURL, apiURL, region string) *configv1.Infrastructure

CreateGCPInfraObject creates an configv1.Infrastructure object

func CreateGCPMachineObj411

func CreateGCPMachineObj411(name, clusterid, role, region, zone string) machinev1beta1.Machine

CreateGCPMachineObj411 makes a single AWS-style machinev1beta1.Machine object with a GCPMachineProviderConfig with a GVK from 4.11+

func CreateGCPMachineObjPre411

func CreateGCPMachineObjPre411(name, clusterid, role, region, zone string) machinev1beta1.Machine

CreateGCPMachineObjPre411 makes a single AWS-style machinev1beta1.Machine object with a GCPMachineProviderConfig with a GVK from pre-4.11

func CreateGCPMachineObjectList

func CreateGCPMachineObjectList(name []string, clusterid, role, region, zone string) (*machinev1beta1.MachineList, []machinev1beta1.Machine)

CreateGCPMachineObjectList makes a MachineList from the slice of names, and returns also a slice of Machine objects for convenience

func CreateInfraObject

func CreateInfraObject(infraName, apiInternalURL, apiURL, region string) *configv1.Infrastructure

CreateInfraObject creates an configv1.Infrastructure object

func CreateLegacyClusterConfig

func CreateLegacyClusterConfig(clusterdomain, infraName, region string, workerCount, masterCount int) *corev1.ConfigMap

CreateLegacyClusterConfig creates kube-config/configmaps/cluster-config-v1 To test https://bugzilla.redhat.com/show_bug.cgi?id=1814332

func CreateMachineObj411

func CreateMachineObj411(name, clusterid, role, region, zone string) machinev1beta1.Machine

CreateMachineObj411 makes a single AWS-style machinev1beta1.Machine object with a AWSMachineProviderConfig with a GVK from 4.11+

func CreateMachineObjPre411

func CreateMachineObjPre411(name, clusterid, role, region, zone string) machinev1beta1.Machine

CreateMachineObjPre411 makes a single AWS-style machinev1beta1.Machine object with a AWSMachineProviderConfig with a GVK from pre-4.11

func CreateMachineObjectList

func CreateMachineObjectList(name []string, clusterid, role, region, zone string) (*machinev1beta1.MachineList, []machinev1beta1.Machine)

CreateMachineObjectList makes a MachineList from the slice of names, and returns also a slice of Machine objects for convenience

func ValidateMachineLB

ValidateMachineLB returns length, names and types (slices) and any error if one The purpose is to have an easy way to condense 12+ lines of code

Types

type Mocks

type Mocks struct {
	FakeKubeClient client.Client
	MockCtrl       *gomock.Controller
	Scheme         *runtime.Scheme
}

func NewTestMock

func NewTestMock(t *testing.T, localObjs []runtime.Object) *Mocks

NewMockTest sets up for a new mock test, pass in some localObjs to seed the fake Kubernetes environment

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL