@@ -4,15 +4,16 @@ import (
4
4
"bytes"
5
5
"context"
6
6
"encoding/json"
7
+ "reflect"
8
+ "testing"
9
+
7
10
configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
8
11
testlibrary "github.com/openshift/library-go/test/library"
9
12
"github.com/stretchr/testify/require"
10
13
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
14
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
12
15
"k8s.io/apimachinery/pkg/util/wait"
13
16
clientcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
14
- "reflect"
15
- "testing"
16
17
17
18
"github.com/openshift/cluster-kube-apiserver-operator/pkg/operator/operatorclient"
18
19
)
@@ -30,21 +31,21 @@ func TestServiceAccountIssuer(t *testing.T) {
30
31
t .Run ("serviceaccountissuer set in authentication config results in apiserver config" , func (t * testing.T ) {
31
32
setServiceAccountIssuer (t , authConfigClient , "https://first.foo.bar" )
32
33
if err := pollForOperandIssuer (t , kubeClient , []string {"https://first.foo.bar" , "https://kubernetes.default.svc" }); err != nil {
33
- t .Errorf (err . Error () )
34
+ t .Errorf ("pollForOperandIssuer failed: %v" , err )
34
35
}
35
36
})
36
37
37
38
t .Run ("second serviceaccountissuer set in authentication config results in apiserver config with two issuers" , func (t * testing.T ) {
38
39
setServiceAccountIssuer (t , authConfigClient , "https://second.foo.bar" )
39
40
if err := pollForOperandIssuer (t , kubeClient , []string {"https://second.foo.bar" , "https://first.foo.bar" , "https://kubernetes.default.svc" }); err != nil {
40
- t .Errorf (err . Error () )
41
+ t .Errorf ("pollForOperandIssuer failed: %v" , err )
41
42
}
42
43
})
43
44
44
45
t .Run ("no serviceaccountissuer set in authentication config results in apiserver config with default issuer set" , func (t * testing.T ) {
45
46
setServiceAccountIssuer (t , authConfigClient , "" )
46
47
if err := pollForOperandIssuer (t , kubeClient , []string {"https://kubernetes.default.svc" }); err != nil {
47
- t .Errorf (err . Error () )
48
+ t .Errorf ("pollForOperandIssuer failed: %v" , err )
48
49
}
49
50
})
50
51
0 commit comments