Merge 1c6d3db472
into de1a4c463c
This commit is contained in:
commit
46e158b14f
6 changed files with 115 additions and 115 deletions
|
@ -61,7 +61,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
exampleBackend = "example-http-svc-1-80"
|
exampleBackend = "example_http-svc-1_80"
|
||||||
TRUE = "true"
|
TRUE = "true"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -518,12 +518,12 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -537,19 +537,19 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -563,7 +563,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -624,24 +624,24 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-foo-http-svc-80": {
|
"example_foo-http-svc_80": {
|
||||||
Name: "example-foo-http-svc-80",
|
Name: "example_foo-http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
},
|
},
|
||||||
"example-foo-http-svc-canary-80": {
|
"example_foo-http-svc-canary_80": {
|
||||||
Name: "example-foo-http-svc-canary-80",
|
Name: "example_foo-http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -655,7 +655,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-foo-http-svc-80",
|
Backend: "example_foo-http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -665,31 +665,31 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-foo-http-svc-80": {
|
"example_foo-http-svc_80": {
|
||||||
Name: "example-foo-http-svc-80",
|
Name: "example_foo-http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-foo-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_foo-http-svc-canary_80"},
|
||||||
},
|
},
|
||||||
"example-foo-http-svc-canary-80": {
|
"example_foo-http-svc-canary_80": {
|
||||||
Name: "example-foo-http-svc-canary-80",
|
Name: "example_foo-http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -703,7 +703,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -743,8 +743,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -774,12 +774,12 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -793,19 +793,19 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -819,7 +819,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -848,8 +848,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
Name: "upstream-default-backend",
|
Name: "upstream-default-backend",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -915,12 +915,12 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -934,19 +934,19 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -960,7 +960,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1005,8 +1005,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
SessionAffinity: ingress.SessionAffinityConfig{
|
SessionAffinity: ingress.SessionAffinityConfig{
|
||||||
AffinityType: "cookie",
|
AffinityType: "cookie",
|
||||||
|
@ -1016,8 +1016,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1031,16 +1031,16 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
SessionAffinity: ingress.SessionAffinityConfig{
|
SessionAffinity: ingress.SessionAffinityConfig{
|
||||||
AffinityType: "cookie",
|
AffinityType: "cookie",
|
||||||
AffinityMode: "balanced",
|
AffinityMode: "balanced",
|
||||||
|
@ -1049,8 +1049,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1071,7 +1071,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1116,8 +1116,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
SessionAffinity: ingress.SessionAffinityConfig{
|
SessionAffinity: ingress.SessionAffinityConfig{
|
||||||
AffinityType: "cookie",
|
AffinityType: "cookie",
|
||||||
|
@ -1127,8 +1127,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1142,16 +1142,16 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
SessionAffinity: ingress.SessionAffinityConfig{
|
SessionAffinity: ingress.SessionAffinityConfig{
|
||||||
AffinityType: "cookie",
|
AffinityType: "cookie",
|
||||||
AffinityMode: "balanced",
|
AffinityMode: "balanced",
|
||||||
|
@ -1160,8 +1160,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1182,7 +1182,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1227,8 +1227,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
SessionAffinity: ingress.SessionAffinityConfig{
|
SessionAffinity: ingress.SessionAffinityConfig{
|
||||||
AffinityType: "cookie",
|
AffinityType: "cookie",
|
||||||
|
@ -1238,8 +1238,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1253,16 +1253,16 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-80": {
|
"example_http-svc_80": {
|
||||||
Name: "example-http-svc-80",
|
Name: "example_http-svc_80",
|
||||||
NoServer: false,
|
NoServer: false,
|
||||||
AlternativeBackends: []string{"example-http-svc-canary-80"},
|
AlternativeBackends: []string{"example_http-svc-canary_80"},
|
||||||
SessionAffinity: ingress.SessionAffinityConfig{
|
SessionAffinity: ingress.SessionAffinityConfig{
|
||||||
AffinityType: "cookie",
|
AffinityType: "cookie",
|
||||||
AffinityMode: "balanced",
|
AffinityMode: "balanced",
|
||||||
|
@ -1271,8 +1271,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1286,7 +1286,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1326,8 +1326,8 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
map[string]*ingress.Backend{
|
map[string]*ingress.Backend{
|
||||||
"example-http-svc-canary-80": {
|
"example_http-svc-canary_80": {
|
||||||
Name: "example-http-svc-canary-80",
|
Name: "example_http-svc-canary_80",
|
||||||
NoServer: true,
|
NoServer: true,
|
||||||
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
TrafficShapingPolicy: ingress.TrafficShapingPolicy{
|
||||||
Weight: 20,
|
Weight: 20,
|
||||||
|
@ -1341,7 +1341,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1354,7 +1354,7 @@ func TestMergeAlternativeBackends(t *testing.T) {
|
||||||
{
|
{
|
||||||
Path: "/",
|
Path: "/",
|
||||||
PathType: &pathTypePrefix,
|
PathType: &pathTypePrefix,
|
||||||
Backend: "example-http-svc-80",
|
Backend: "example_http-svc_80",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1722,8 +1722,8 @@ func TestGetBackendServers(t *testing.T) {
|
||||||
t.Errorf("server location 0 should not be default backend")
|
t.Errorf("server location 0 should not be default backend")
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Locations[0].Backend != "example-http-svc-80" {
|
if s.Locations[0].Backend != "example_http-svc_80" {
|
||||||
t.Errorf("location backend should be 'example-http-svc-80', got '%s'", s.Locations[0].Backend)
|
t.Errorf("location backend should be 'example_http-svc_80', got '%s'", s.Locations[0].Backend)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SetConfigMap: testConfigMap,
|
SetConfigMap: testConfigMap,
|
||||||
|
@ -1890,7 +1890,7 @@ func TestGetBackendServers(t *testing.T) {
|
||||||
t.Errorf("server hostname should be 'example.com', got '%s'", s.Hostname)
|
t.Errorf("server hostname should be 'example.com', got '%s'", s.Hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Locations[0].Backend != "example-http-svc-80" {
|
if s.Locations[0].Backend != "example_http-svc_80" {
|
||||||
t.Errorf("location backend should be 'example-http-svc-80', got '%s'", s.Locations[0].Backend)
|
t.Errorf("location backend should be 'example-http-svc-80', got '%s'", s.Locations[0].Backend)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2151,7 +2151,7 @@ func TestGetBackendServers(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Locations[0].Backend != exampleBackend || s.Locations[1].Backend != exampleBackend || s.Locations[2].Backend != exampleBackend {
|
if s.Locations[0].Backend != exampleBackend || s.Locations[1].Backend != exampleBackend || s.Locations[2].Backend != exampleBackend {
|
||||||
t.Errorf("all location backend should be 'example-http-svc-1-80'")
|
t.Errorf("all location backend should be '%s'", exampleBackend)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(upstreams) != 3 {
|
if len(upstreams) != 3 {
|
||||||
|
@ -2160,14 +2160,14 @@ func TestGetBackendServers(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if upstreams[0].Name != exampleBackend {
|
if upstreams[0].Name != exampleBackend {
|
||||||
t.Errorf("example-http-svc-1-80 should be first upstream, got %s", upstreams[0].Name)
|
t.Errorf("%s should be first upstream, got %s", exampleBackend, upstreams[0].Name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if upstreams[0].NoServer {
|
if upstreams[0].NoServer {
|
||||||
t.Errorf("'example-http-svc-1-80' should be primary upstream, got as alternative upstream")
|
t.Errorf("'%s' should be primary upstream, got as alternative upstream", exampleBackend)
|
||||||
}
|
}
|
||||||
if len(upstreams[0].AlternativeBackends) != 1 || upstreams[0].AlternativeBackends[0] != "example-http-svc-2-80" {
|
if len(upstreams[0].AlternativeBackends) != 1 || upstreams[0].AlternativeBackends[0] != "example_http-svc-2_80" {
|
||||||
t.Errorf("example-http-svc-2-80 should be alternative upstream for 'example-http-svc-1-80'")
|
t.Errorf("example_http-svc-2_80 should be alternative upstream for '%s'", exampleBackend)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SetConfigMap: testConfigMap,
|
SetConfigMap: testConfigMap,
|
||||||
|
|
|
@ -50,13 +50,13 @@ func newUpstream(name string) *ingress.Backend {
|
||||||
func upstreamName(namespace string, service *networking.IngressServiceBackend) string {
|
func upstreamName(namespace string, service *networking.IngressServiceBackend) string {
|
||||||
if service != nil {
|
if service != nil {
|
||||||
if service.Port.Number > 0 {
|
if service.Port.Number > 0 {
|
||||||
return fmt.Sprintf("%s-%s-%d", namespace, service.Name, service.Port.Number)
|
return fmt.Sprintf("%s_%s_%d", namespace, service.Name, service.Port.Number)
|
||||||
}
|
}
|
||||||
if service.Port.Name != "" {
|
if service.Port.Name != "" {
|
||||||
return fmt.Sprintf("%s-%s-%s", namespace, service.Name, service.Port.Name)
|
return fmt.Sprintf("%s_%s_%s", namespace, service.Name, service.Port.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s-INVALID", namespace)
|
return fmt.Sprintf("%s_INVALID", namespace)
|
||||||
}
|
}
|
||||||
|
|
||||||
// upstreamServiceNameAndPort verifies if service is not nil, and then return the
|
// upstreamServiceNameAndPort verifies if service is not nil, and then return the
|
||||||
|
|
|
@ -1091,8 +1091,8 @@ var _ = framework.DescribeAnnotation("canary-*", func() {
|
||||||
|
|
||||||
f.WaitForNginxServer("_",
|
f.WaitForNginxServer("_",
|
||||||
func(server string) bool {
|
func(server string) bool {
|
||||||
upstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s-%s-%s";`, f.Namespace, framework.HTTPBunService, "80")
|
upstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s_%s_%s";`, f.Namespace, framework.HTTPBunService, "80")
|
||||||
canaryUpstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s-%s-%s";`, f.Namespace, canaryService, "80")
|
canaryUpstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s_%s_%s";`, f.Namespace, canaryService, "80")
|
||||||
|
|
||||||
return strings.Contains(server, fmt.Sprintf(`set $ingress_name "%v";`, host)) &&
|
return strings.Contains(server, fmt.Sprintf(`set $ingress_name "%v";`, host)) &&
|
||||||
!strings.Contains(server, `set $proxy_upstream_name "upstream-default-backend";`) &&
|
!strings.Contains(server, `set $proxy_upstream_name "upstream-default-backend";`) &&
|
||||||
|
|
|
@ -32,7 +32,7 @@ import (
|
||||||
|
|
||||||
// GetLbAlgorithm returns algorithm identifier for the given backend
|
// GetLbAlgorithm returns algorithm identifier for the given backend
|
||||||
func (f *Framework) GetLbAlgorithm(serviceName string, servicePort int) (string, error) {
|
func (f *Framework) GetLbAlgorithm(serviceName string, servicePort int) (string, error) {
|
||||||
backendName := fmt.Sprintf("%s-%s-%v", f.Namespace, serviceName, servicePort)
|
backendName := fmt.Sprintf("%s_%s_%v", f.Namespace, serviceName, servicePort)
|
||||||
cmd := fmt.Sprintf("/dbg backends get %s", backendName)
|
cmd := fmt.Sprintf("/dbg backends get %s", backendName)
|
||||||
|
|
||||||
output, err := f.ExecIngressPod(cmd)
|
output, err := f.ExecIngressPod(cmd)
|
||||||
|
|
|
@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("[SSL] [Flag] default-ssl-certificate", f
|
||||||
f.EnsureIngress(ing)
|
f.EnsureIngress(ing)
|
||||||
|
|
||||||
ginkgo.By("making sure new ingress is deployed")
|
ginkgo.By("making sure new ingress is deployed")
|
||||||
expectedConfig := fmt.Sprintf(`set $proxy_upstream_name "%v-%v-%v";`, f.Namespace, service, port)
|
expectedConfig := fmt.Sprintf(`set $proxy_upstream_name "%v_%v_%v";`, f.Namespace, service, port)
|
||||||
f.WaitForNginxServer("_", func(cfg string) bool {
|
f.WaitForNginxServer("_", func(cfg string) bool {
|
||||||
return strings.Contains(cfg, expectedConfig)
|
return strings.Contains(cfg, expectedConfig)
|
||||||
})
|
})
|
||||||
|
@ -90,7 +90,7 @@ var _ = framework.IngressNginxDescribe("[SSL] [Flag] default-ssl-certificate", f
|
||||||
assert.Nil(ginkgo.GinkgoT(), err)
|
assert.Nil(ginkgo.GinkgoT(), err)
|
||||||
|
|
||||||
ginkgo.By("making sure new ingress is deployed")
|
ginkgo.By("making sure new ingress is deployed")
|
||||||
expectedConfig := fmt.Sprintf(`set $proxy_upstream_name "%v-%v-%v";`, f.Namespace, service, port)
|
expectedConfig := fmt.Sprintf(`set $proxy_upstream_name "%v_%v_%v";`, f.Namespace, service, port)
|
||||||
f.WaitForNginxServer(host, func(cfg string) bool {
|
f.WaitForNginxServer(host, func(cfg string) bool {
|
||||||
return strings.Contains(cfg, expectedConfig)
|
return strings.Contains(cfg, expectedConfig)
|
||||||
})
|
})
|
||||||
|
|
|
@ -37,7 +37,7 @@ var _ = framework.IngressNginxDescribe("Dynamic $proxy_host", func() {
|
||||||
disableSnippet := f.AllowSnippetConfiguration()
|
disableSnippet := f.AllowSnippetConfiguration()
|
||||||
defer disableSnippet()
|
defer disableSnippet()
|
||||||
|
|
||||||
upstreamName := fmt.Sprintf("%v-%v-80", f.Namespace, framework.EchoService)
|
upstreamName := fmt.Sprintf("%v_%v_80", f.Namespace, framework.EchoService)
|
||||||
annotations := map[string]string{
|
annotations := map[string]string{
|
||||||
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Custom-Header: $proxy_host"`,
|
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Custom-Header: $proxy_host"`,
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ var _ = framework.IngressNginxDescribe("Dynamic $proxy_host", func() {
|
||||||
disableSnippet := f.AllowSnippetConfiguration()
|
disableSnippet := f.AllowSnippetConfiguration()
|
||||||
defer disableSnippet()
|
defer disableSnippet()
|
||||||
|
|
||||||
upstreamName := fmt.Sprintf("%v-%v-80", f.Namespace, framework.EchoService)
|
upstreamName := fmt.Sprintf("%v_%v_80", f.Namespace, framework.EchoService)
|
||||||
upstreamVHost := "different.host"
|
upstreamVHost := "different.host"
|
||||||
annotations := map[string]string{
|
annotations := map[string]string{
|
||||||
"nginx.ingress.kubernetes.io/upstream-vhost": upstreamVHost,
|
"nginx.ingress.kubernetes.io/upstream-vhost": upstreamVHost,
|
||||||
|
|
Loading…
Reference in a new issue