Skip to content
This repository was archived by the owner on Mar 26, 2021. It is now read-only.

Commit 41c0fd7

Browse files
committed
Fix the tests to work with a locally-defined object reference.
1 parent ce7b35e commit 41c0fd7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/integration/server_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ import (
2020
"testing"
2121

2222
"github.com/kubernetes-sigs/kubebuilder/pkg/test"
23-
"k8s.io/api/core/v1"
2423
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
2524
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26-
"k8s.io/apimachinery/pkg/types"
2725
"k8s.io/cluster-registry/pkg/apis/clusterregistry/v1alpha1"
2826
crclientset "k8s.io/cluster-registry/pkg/client/clientset/versioned"
2927
)
@@ -102,11 +100,10 @@ func testClusterUpdate(t *testing.T, clientset *crclientset.Clientset, clusterNa
102100
authSecretName := "authSecret"
103101

104102
cluster.Spec.AuthInfo = v1alpha1.AuthInfo{
105-
ControllerAuthInfo: &v1.ObjectReference{
103+
Controller: &v1alpha1.ObjectReference{
106104
Kind: "Secret",
107105
Name: authSecretName,
108106
Namespace: "default",
109-
UID: types.UID("testUID"),
110107
},
111108
}
112109

@@ -118,9 +115,9 @@ func testClusterUpdate(t *testing.T, clientset *crclientset.Clientset, clusterNa
118115
t.Fatalf("Expected a cluster, got nil")
119116
} else if cluster.Name != clusterName {
120117
t.Fatalf("Expected a cluster named 'cluster', got a cluster named '%v'.", cluster.Name)
121-
} else if cluster.Spec.AuthInfo.ControllerAuthInfo == nil || cluster.Spec.AuthInfo.ControllerAuthInfo.Name != authSecretName {
118+
} else if cluster.Spec.AuthInfo.Controller == nil || cluster.Spec.AuthInfo.Controller.Name != authSecretName {
122119
t.Fatalf("Expected a cluster controller auth info named '%v', got cluster auth provider '%v'",
123-
authSecretName, cluster.Spec.AuthInfo.ControllerAuthInfo)
120+
authSecretName, cluster.Spec.AuthInfo.Controller)
124121
}
125122
}
126123

0 commit comments

Comments
 (0)