File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,28 @@ import (
2020 . "github.com/onsi/ginkgo/v2"
2121 . "github.com/onsi/gomega"
2222 corev1 "k8s.io/api/core/v1"
23+ apierrors "k8s.io/apimachinery/pkg/api/errors"
2324 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2425 clusterutilv1 "sigs.k8s.io/cluster-api/util"
2526 v1beta1conditions "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions"
2627 "sigs.k8s.io/controller-runtime/pkg/client"
2728
2829 infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1"
30+ "sigs.k8s.io/cluster-api-provider-vsphere/pkg/manager"
2931)
3032
3133var _ = Describe ("VSphereClusterIdentity Reconciler" , func () {
3234 controllerNamespace := testEnv .Manager .GetControllerManagerContext ().Namespace
35+ if controllerNamespace != manager .DefaultPodNamespace {
36+ ns := & corev1.Namespace {
37+ ObjectMeta : metav1.ObjectMeta {
38+ Name : controllerNamespace ,
39+ },
40+ }
41+ if err := testEnv .Client .Create (ctx , ns ); ! apierrors .IsAlreadyExists (err ) {
42+ Expect (err ).ToNot (HaveOccurred ())
43+ }
44+ }
3345
3446 Context ("Reconcile Normal" , func () {
3547 It ("should set the ownerRef on a secret and set Ready condition" , func () {
You can’t perform that action at this time.
0 commit comments