Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Small post-review fixes, remove not valid IT test
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmiskiewicz committed Sep 20, 2018
1 parent 28d2eaf commit 156ab76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 44 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/broker_client_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (m *BrokerClientManager) UpdateBrokerClient(brokerKey BrokerKey, clientConf

existing, found := m.clients[brokerKey]

if !found || m.configHasChanged(existing.clientConfig, clientConfig) {
if !found || configHasChanged(existing.clientConfig, clientConfig) {
glog.V(4).Infof("Updating OSB client for broker %s, URL: %s", brokerKey.String(), clientConfig.URL)
return m.createClient(brokerKey, clientConfig)
}
Expand Down Expand Up @@ -122,7 +122,7 @@ func (m *BrokerClientManager) createClient(brokerKey BrokerKey, clientConfig *os
return client, nil
}

func (m *BrokerClientManager) configHasChanged(cfg1 *osb.ClientConfiguration, cfg2 *osb.ClientConfiguration) bool {
func configHasChanged(cfg1 *osb.ClientConfiguration, cfg2 *osb.ClientConfiguration) bool {
return !reflect.DeepEqual(cfg1, cfg2)
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/controller_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ func TestReconcileServiceInstanceNonExistentClusterServiceBroker(t *testing.T) {
}
}

// TestReconcileServiceInstanceWithNotExistingBroker tests reconcileInstance when the BrokerClientManager instance does not contain client for the broker.
// TestReconcileServiceInstanceWithNotExistingBroker tests reconcileInstance
// when the BrokerClientManager instance does not contain client for the broker.
func TestReconcileServiceInstanceWithNotExistingBroker(t *testing.T) {
fakeKubeClient, fakeCatalogClient, fakeClusterServiceBrokerClient, testController, sharedInformers := newTestController(t, noFakeActions())

Expand Down
41 changes: 0 additions & 41 deletions test/integration/controller_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,47 +222,6 @@ func TestCreateServiceInstanceNonExistentClusterServiceBroker(t *testing.T) {
})
}

// TestCreateServiceInstanceWithAuthError tests creating a SerivceInstance when
// the secret containing the broker authorization info cannot be found.
func TestCreateServiceInstanceWithAuthError(t *testing.T) {
t.Skip("not valid now")
ct := &controllerTest{
t: t,
broker: func() *v1beta1.ClusterServiceBroker {
b := getTestBroker()
b.Spec.AuthInfo = &v1beta1.ClusterServiceBrokerAuthInfo{
Basic: &v1beta1.ClusterBasicAuthConfig{
SecretRef: &v1beta1.ObjectReference{
Namespace: testNamespace,
Name: "secret-name",
},
},
}
return b
}(),
instance: getTestInstance(),
skipVerifyingInstanceSuccess: true,
preCreateBroker: func(ct *controllerTest) {
prependGetSecretReaction(ct.kubeClient, "secret-name", map[string][]byte{
"username": []byte("user"),
"password": []byte("pass"),
})
},
preCreateInstance: func(ct *controllerTest) {
prependGetSecretNotFoundReaction(ct.kubeClient)
},
}
ct.run(func(ct *controllerTest) {
if err := util.WaitForInstanceCondition(ct.client, testNamespace, testInstanceName, v1beta1.ServiceInstanceCondition{
Type: v1beta1.ServiceInstanceConditionReady,
Status: v1beta1.ConditionFalse,
Reason: "ErrorGettingAuthCredentials",
}); err != nil {
t.Fatalf("error waiting for instance reconciliation to fail: %v", err)
}
})
}

// TestCreateServiceInstanceWithParameters tests creating a ServiceInstance
// with parameters.
func TestCreateServiceInstanceWithParameters(t *testing.T) {
Expand Down

0 comments on commit 156ab76

Please sign in to comment.