Skip to content

Commit

Permalink
Fix mergeableIngress typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean-Coakley committed Aug 24, 2018
1 parent 6051d2b commit 00d452f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions nginx-controller/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func (lbc *LoadBalancerController) syncIng(task Task) {
}
return
}
err = lbc.cnf.AddOrUpdateMergableIngress(mergeableIngExs)
err = lbc.cnf.AddOrUpdateMergeableIngress(mergeableIngExs)
if err != nil {
lbc.recorder.Eventf(ing, api_v1.EventTypeWarning, "AddedOrUpdatedWithError", "Configuration for %v(Master) was added or updated, but not applied: %v", key, err)
for _, minion := range mergeableIngExs.Minions {
Expand Down Expand Up @@ -804,7 +804,7 @@ func (lbc *LoadBalancerController) syncSecret(task Task) {
glog.Errorf("Ignoring Ingress %v(Minion): %v", minion.Name, err)
continue
}
err = lbc.cnf.AddOrUpdateMergableIngress(mergeableIngress)
err = lbc.cnf.AddOrUpdateMergeableIngress(mergeableIngress)
if err != nil {
glog.Errorf("Failed to update Ingress %v(Master) of %v(Minion): %v", master.Name, minion.Name, err)
}
Expand Down Expand Up @@ -864,7 +864,7 @@ func (lbc *LoadBalancerController) syncSecret(task Task) {
glog.Errorf("Ignoring Ingress %v(Minion): %v", minion.Name, err)
continue
}
err = lbc.cnf.AddOrUpdateMergableIngress(mergeableIngress)
err = lbc.cnf.AddOrUpdateMergeableIngress(mergeableIngress)
if err != nil {
glog.Errorf("Failed to update Ingress %v(Master) of %v(Minion): %v", master.Name, minion.Name, err)
}
Expand Down
4 changes: 2 additions & 2 deletions nginx-controller/nginx/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func (cnf *Configurator) addOrUpdateIngress(ingEx *IngressEx) error {
return nil
}

// AddOrUpdateMergableIngress adds or updates NGINX configuration for the Ingress resources with Mergeable Types
func (cnf *Configurator) AddOrUpdateMergableIngress(mergeableIngs *MergeableIngresses) error {
// AddOrUpdateMergeableIngress adds or updates NGINX configuration for the Ingress resources with Mergeable Types
func (cnf *Configurator) AddOrUpdateMergeableIngress(mergeableIngs *MergeableIngresses) error {
if err := cnf.addOrUpdateMergeableIngress(mergeableIngs); err != nil {
return fmt.Errorf("Error when adding or updating ingress %v/%v: %v", mergeableIngs.Master.Ingress.Namespace, mergeableIngs.Master.Ingress.Name, err)
}
Expand Down
18 changes: 9 additions & 9 deletions nginx-controller/nginx/configurator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,20 +668,20 @@ func TestAddOrUpdateIngress(t *testing.T) {
}
}

func TestAddOrUpdateMergableIngress(t *testing.T) {
func TestAddOrUpdateMergeableIngress(t *testing.T) {
cnf, err := createTestConfigurator()
if err != nil {
t.Errorf("Failed to create a test configurator: %v", err)
}
mergeableIngess := createMergeableCafeIngress()
err = cnf.AddOrUpdateMergableIngress(mergeableIngess)
err = cnf.AddOrUpdateMergeableIngress(mergeableIngess)
if err != nil {
t.Errorf("AddOrUpdateMergableIngress returned \n%v, expected \n%v", err, nil)
t.Errorf("AddOrUpdateMergeableIngress returned \n%v, expected \n%v", err, nil)
}

cnfHasMergableIngress := cnf.HasIngress(mergeableIngess.Master.Ingress)
if !cnfHasMergableIngress {
t.Errorf("AddOrUpdateMergableIngress didn't add mergable ingress successfully. HasIngress returned %v, expected %v", cnfHasMergableIngress, true)
cnfHasMergeableIngress := cnf.HasIngress(mergeableIngess.Master.Ingress)
if !cnfHasMergeableIngress {
t.Errorf("AddOrUpdateMergeableIngress didn't add mergeable ingress successfully. HasIngress returned %v, expected %v", cnfHasMergeableIngress, true)
}
}

Expand All @@ -698,16 +698,16 @@ func TestAddOrUpdateIngressFailsWithInvalidIngressTemplate(t *testing.T) {
}
}

func TestAddOrUpdateMergableIngressFailsWithInvalidIngressTemplate(t *testing.T) {
func TestAddOrUpdateMergeableIngressFailsWithInvalidIngressTemplate(t *testing.T) {
cnf, err := createTestConfiguratorInvalidIngressTemplate()
if err != nil {
t.Errorf("Failed to create a test configurator: %v", err)
}

mergeableIngess := createMergeableCafeIngress()
err = cnf.AddOrUpdateMergableIngress(mergeableIngess)
err = cnf.AddOrUpdateMergeableIngress(mergeableIngess)
if err == nil {
t.Errorf("AddOrUpdateMergableIngress returned \n%v, but expected \n%v", nil, "template execution error")
t.Errorf("AddOrUpdateMergeableIngress returned \n%v, but expected \n%v", nil, "template execution error")
}
}

Expand Down

0 comments on commit 00d452f

Please sign in to comment.