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

Commit

Permalink
Fix the tests to work with a locally-defined object reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
perotinus committed Jun 1, 2018
1 parent ce7b35e commit 41c0fd7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/integration/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ import (
"testing"

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

cluster.Spec.AuthInfo = v1alpha1.AuthInfo{
ControllerAuthInfo: &v1.ObjectReference{
Controller: &v1alpha1.ObjectReference{
Kind: "Secret",
Name: authSecretName,
Namespace: "default",
UID: types.UID("testUID"),
},
}

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

Expand Down

0 comments on commit 41c0fd7

Please sign in to comment.