Skip to content

Commit 117bfbd

Browse files
Jay BoydJeff Peeler
Jay Boyd
authored and
Jeff Peeler
committed
clean up error logging (#1443)
1 parent dff470f commit 117bfbd

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

pkg/controller/controller_instance.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,10 +1251,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
12511251
// the instance.
12521252
errText := ""
12531253
if httpErr, ok := osb.IsHTTPError(err); ok {
1254-
errText = fmt.Sprintf(
1255-
"Status code: %d; ErrorMessage: %q; description: %q",
1256-
httpErr.StatusCode, httpErr.ErrorMessage, httpErr.Description,
1257-
)
1254+
errText = httpErr.Error()
12581255
} else {
12591256
errText = err.Error()
12601257
}

pkg/controller/controller_instance_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ func TestPollServiceInstanceClusterServiceBrokerError(t *testing.T) {
20652065

20662066
events := getRecordedEvents(testController)
20672067
assertNumEvents(t, events, 1)
2068-
expectedEvent := corev1.EventTypeWarning + " " + errorPollingLastOperationReason + " " + "Error polling last operation: Status code: 403; ErrorMessage: %!q(*string=<nil>); description: %!q(*string=<nil>)"
2068+
expectedEvent := corev1.EventTypeWarning + " " + errorPollingLastOperationReason + " " + "Error polling last operation: Status: 403; ErrorMessage: <nil>; Description: <nil>; ResponseError: <nil>"
20692069
if e, a := expectedEvent, events[0]; e != a {
20702070
t.Fatalf("Received unexpected event: %v\nExpected: %v", a, e)
20712071
}

0 commit comments

Comments
 (0)