Skip to content

Commit ed75774

Browse files
author
Doug Davis
committed
Minor fixes based on go report card
Signed-off-by: Doug Davis <[email protected]>
1 parent a6bb576 commit ed75774

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ $(BINDIR)/e2e.test: .init
214214
.PHONY: verify verify-client-gen
215215
verify: .init .generate_files verify-client-gen
216216
@echo Running gofmt:
217-
@$(DOCKER_CMD) gofmt -l -s $(TOP_SRC_DIRS) > .out 2>&1 || true
217+
@$(DOCKER_CMD) gofmt -l -s $(TOP_TEST_DIRS) $(TOP_SRC_DIRS) &> .out || true
218218
@bash -c '[ "`cat .out`" == "" ] || \
219219
(echo -e "\n*** Please 'gofmt' the following:" ; cat .out ; echo ; false)'
220220
@rm .out

contrib/pkg/broker/user_provided/controller/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ func (c *userProvidedController) CreateServiceInstance(
9090
}
9191
var cred brokerapi.Credential
9292
err = json.Unmarshal(jsonCred, &cred)
93+
if err != nil {
94+
glog.Errorf("Failed to unmarshal credentials: %v", err)
95+
return nil, err
96+
}
9397

9498
c.instanceMap[id] = &userProvidedServiceInstance{
9599
Name: id,

pkg/controller/controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import (
5353
// - tests for the methods on controller.go
5454
// - test fixtures used in other controller_*_test.go files
5555
//
56-
// Other controller_*_test.go files contain tests related to the reconcilation
56+
// Other controller_*_test.go files contain tests related to the reconciliation
5757
// loops for the different catalog API resources.
5858

5959
const (

test/e2e/walkthrough.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
6060

6161
It("Run walkthrough-example ", func() {
6262
var (
63-
brokerName = upsbrokername
63+
brokerName = upsbrokername
6464
serviceclassName = "user-provided-service"
65-
testns = "test-ns"
66-
instanceName = "ups-instance"
67-
bindingName = "ups-binding"
65+
testns = "test-ns"
66+
instanceName = "ups-instance"
67+
bindingName = "ups-binding"
6868
)
6969

7070
//Broker and ServiceClass should become ready
@@ -79,7 +79,7 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
7979
}
8080

8181
By("Creating a Broker")
82-
url := "http://" + upsbrokername + "." +f.Namespace.Name + ".svc.cluster.local"
82+
url := "http://" + upsbrokername + "." + f.Namespace.Name + ".svc.cluster.local"
8383
broker := &v1alpha1.Broker{
8484
ObjectMeta: metav1.ObjectMeta{
8585
Name: brokerName,
@@ -95,7 +95,7 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
9595
err = util.WaitForBrokerCondition(f.ServiceCatalogClientSet.ServicecatalogV1alpha1(),
9696
broker.Name,
9797
v1alpha1.BrokerCondition{
98-
Type: v1alpha1.BrokerConditionReady,
98+
Type: v1alpha1.BrokerConditionReady,
9999
Status: v1alpha1.ConditionTrue,
100100
},
101101
)
@@ -113,23 +113,24 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
113113
By("Creating a Instance")
114114
instance := &v1alpha1.Instance{
115115
ObjectMeta: metav1.ObjectMeta{
116-
Name: instanceName,
116+
Name: instanceName,
117117
Namespace: testnamespace.Name,
118118
},
119119
Spec: v1alpha1.InstanceSpec{
120120
ServiceClassName: serviceclassName,
121-
PlanName: "default",
121+
PlanName: "default",
122122
},
123123
}
124124
instance, err = f.ServiceCatalogClientSet.ServicecatalogV1alpha1().Instances(testnamespace.Name).Create(instance)
125125
Expect(err).NotTo(HaveOccurred(), "failed to create instance")
126+
Expect(instance).NotTo(BeNil())
126127

127128
By("Waiting for Instance to be ready")
128129
err = util.WaitForInstanceCondition(f.ServiceCatalogClientSet.ServicecatalogV1alpha1(),
129130
testnamespace.Name,
130131
instanceName,
131132
v1alpha1.InstanceCondition{
132-
Type: v1alpha1.InstanceConditionReady,
133+
Type: v1alpha1.InstanceConditionReady,
133134
Status: v1alpha1.ConditionTrue,
134135
},
135136
)
@@ -139,7 +140,7 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
139140
By("Creating a Binding")
140141
binding := &v1alpha1.Binding{
141142
ObjectMeta: metav1.ObjectMeta{
142-
Name: bindingName,
143+
Name: bindingName,
143144
Namespace: testnamespace.Name,
144145
},
145146
Spec: v1alpha1.BindingSpec{
@@ -151,13 +152,14 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
151152
}
152153
binding, err = f.ServiceCatalogClientSet.ServicecatalogV1alpha1().Bindings(testnamespace.Name).Create(binding)
153154
Expect(err).NotTo(HaveOccurred(), "failed to create binding")
155+
Expect(binding).NotTo(BeNil())
154156

155157
By("Waiting for Binding to be ready")
156158
err = util.WaitForBindingCondition(f.ServiceCatalogClientSet.ServicecatalogV1alpha1(),
157159
testnamespace.Name,
158160
bindingName,
159161
v1alpha1.BindingCondition{
160-
Type: v1alpha1.BindingConditionReady,
162+
Type: v1alpha1.BindingConditionReady,
161163
Status: v1alpha1.ConditionTrue,
162164
},
163165
)

0 commit comments

Comments
 (0)