fix make verify-all failures

This commit is contained in:
Zenara Daley 2018-04-12 14:14:43 -04:00
parent 4b76ad14bb
commit 9198e2c14b
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -645,14 +645,14 @@ func buildUpstreamName(host string, b interface{}, loc interface{}, dynamicConfi
upstreamName := location.Backend
if !dynamicConfigurationEnabled{
if !dynamicConfigurationEnabled {
for _, backend := range backends {
if backend.Name == location.Backend {
if backend.SessionAffinity.AffinityType == "cookie" &&
isSticky(host, location, backend.SessionAffinity.CookieSessionAffinity.Locations) {
upstreamName = fmt.Sprintf("sticky-%v", upstreamName)
}
break
}
}

View file

@ -730,8 +730,8 @@ func TestBuildUpstreamName(t *testing.T) {
expected := defaultBackend
if tc.Sticky {
if !tc.DynamicConfigurationEnabled{
expected = fmt.Sprintf("sticky-" + expected)
if !tc.DynamicConfigurationEnabled {
expected = fmt.Sprintf("sticky-" + expected)
}
backend.SessionAffinity = ingress.SessionAffinityConfig{
@ -751,4 +751,4 @@ func TestBuildUpstreamName(t *testing.T) {
t.Errorf("%s: expected \n'%v'\nbut returned \n'%v'", k, expected, pp)
}
}
}
}