@@ -59,26 +59,34 @@ spec:
59
59
{ {- end } }
60
60
rules:
61
61
{ {- range $routeObject .rules } }
62
- - backendRefs:
63
- { {- range .backendRefs } }
64
- { { $service := include " bjw-s.common.lib.service.getByIdentifier" (dict " rootContext" $rootContext " id" .name) | fromYaml -} }
65
- { { $servicePrimaryPort := dict -} }
66
- { { if $service -} }
67
- { { $servicePrimaryPort = include " bjw-s.common.lib.service.primaryPort" (dict " rootContext" $rootContext " serviceObject" $service ) | fromYaml -} }
62
+ { {- $hasRequestRedirect := false -} }
63
+ { {- range .filters } }
64
+ { {- if eq .type " RequestRedirect" } }
65
+ { {- $hasRequestRedirect = true -} }
66
+ { {- end } }
67
+ { {- end } }
68
+ { {- if not $hasRequestRedirect } }
69
+ - backendRefs:
70
+ { {- range .backendRefs } }
71
+ { { $service := include " bjw-s.common.lib.service.getByIdentifier" (dict " rootContext" $rootContext " id" .name) | fromYaml -} }
72
+ { { $servicePrimaryPort := dict -} }
73
+ { { if $service -} }
74
+ { { $servicePrimaryPort = include " bjw-s.common.lib.service.primaryPort" (dict " rootContext" $rootContext " serviceObject" $service ) | fromYaml -} }
75
+ { {- end } }
76
+ - group: { { default " " .group | quote} }
77
+ kind: { { default " Service" .kind } }
78
+ name: { { default .name $service .name } }
79
+ namespace: { { default $rootContext .Release.Namespace .namespace } }
80
+ port: { { default .port $servicePrimaryPort .port } }
81
+ weight: { { include " bjw-s.common.lib.defaultKeepNonNullValue" (dict " value" .weight " default" 1) } }
68
82
{ {- end } }
69
- - group: { { default " " .group | quote} }
70
- kind: { { default " Service" .kind } }
71
- name: { { default .name $service .name } }
72
- namespace: { { default $rootContext .Release.Namespace .namespace } }
73
- port: { { default .port $servicePrimaryPort .port } }
74
- weight: { { include " bjw-s.common.lib.defaultKeepNonNullValue" (dict " value" .weight " default" 1) } }
75
83
{ {- end } }
76
84
{ {- if or (eq $routeKind " HTTPRoute" ) (eq $routeKind " GRPCRoute" ) } }
77
85
{ {- with .matches } }
78
86
matches:
79
87
{ {- toYaml . | nindent 6 } }
80
88
{ {- end } }
81
- { {- with .filters } }
89
+ { {- with .filters } }
82
90
filters:
83
91
{ {- toYaml . | nindent 6 } }
84
92
{ {- end } }
0 commit comments