func NewTestMock(t *testing.T, localObjs []runtime.Object) *Mocks {
	mockctrl := gomock.NewController(t)
	s := scheme.Scheme
	if err := configv1.AddToScheme(s); err != nil {
		t.Fatalf("Couldn't add configv1 scheme: (%v)", err)
	}
	if err := machineapi.AddToScheme(s); err != nil {
		t.Fatalf("Couldn't add machine scheme: (%v)", err)
	}
	if err := cloudingressv1alpha1.SchemeBuilder.AddToScheme(s); err != nil {
		t.Fatalf("Couldn't add cloudingressv1alpha1 scheme: (%v)", err)
	}
	if err := operv1.AddToScheme(s); err != nil {
		t.Fatalf("Unable to add route scheme: (%v)", err)
	}
	ret := &Mocks{
		FakeKubeClient: fake.NewClientBuilder().WithScheme(s).WithRuntimeObjects(localObjs...).Build(),
		MockCtrl:       mockctrl,
		Scheme:         s,
	}
	return ret
}
NewMockTest sets up for a new mock test, pass in some localObjs to seed the fake Kubernetes environment
package testutils
import (
	"fmt"
	"testing"
	"github.com/golang/mock/gomock"
	configv1 "github.com/openshift/api/config/v1"
	cloudingressv1alpha1 "github.com/openshift/cloud-ingress-operator/pkg/apis/cloudingress/v1alpha1"
	operv1 "github.com/openshift/api/operator/v1"
	gcpproviderapi "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1"
	machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/client-go/kubernetes/scheme"
	"k8s.io/utils/pointer"
	awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1beta1"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/client/fake"
)
const masterMachineLabel string = "machine.openshift.io/cluster-api-machine-role"
const DefaultRegionName string = "us-east-1"
const DefaultAzName string = "us-east-1a"
const DefaultAPIEndpoint string = "https://api.unit.test:6443"
const DefaultClusterDomain string = "unit.test"
const ClusterTokenId string = "12345"
type Mocks struct {
	FakeKubeClient client.Client
	MockCtrl       *gomock.Controller
	Scheme         *runtime.Scheme
}
const legacyConfig string = `apiVersion: v1
baseDomain: %s
compute:
- hyperthreading: Enabled
  name: worker
  platform:
    aws:
      rootVolume:
        iops: 100
        size: 32
        type: gp2
      type: m5.xlarge
      zones:
      - %s
      - %s
      - %s
  replicas: %d
controlPlane:
  hyperthreading: Enabled1234
  name: master
  platform:
    aws:
      rootVolume:
        iops: 1000
        size: 350
        type: io1
      type: m5.xlarge
      zones:
      - %s
      - %s
      - %s
  replicas: %d
metadata:
  creationTimestamp: null
  name: %s
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineCIDR: 10.0.0.0/16
  networkType: OpenShiftSDN
  serviceNetwork:
  - 172.30.0.0/16
platform:
  aws:
    region: %s
pullSecret: ""
sshKey: |
  ssh-rsa nothingreal
`