Skip to content

Commit ebc3e19

Browse files
committed
fix test data by removing preprocessed inputs
1 parent aa0f809 commit ebc3e19

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

internal/configs/version1/__snapshots__/template_test.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ server {
928928
929929
930930
931-
location ~* "^~* "^/(latte|espresso)"" {
931+
location ~* "^/(latte|espresso)" {
932932
set $service "";
933933
status_zone "";
934934
rewrite (?i)^/(latte|espresso) /drinks/$1 break;
@@ -975,7 +975,7 @@ server {
975975
976976
977977
978-
location ~ "^~ "^/(coffee|tea)"" {
978+
location ~ "^/(coffee|tea)" {
979979
set $service "";
980980
status_zone "";
981981
rewrite ^/(coffee|tea) /beverages/$1 break;
@@ -1022,7 +1022,7 @@ server {
10221022
10231023
10241024
1025-
location ~ "^~ "^/menu/(hot|cold)/(coffee|tea)"" {
1025+
location ~ "^/menu/(hot|cold)/(coffee|tea)" {
10261026
set $service "";
10271027
status_zone "";
10281028
rewrite ^/menu/(hot|cold)/(coffee|tea) /drinks/$1/$2 break;
@@ -1069,7 +1069,7 @@ server {
10691069
10701070
10711071
1072-
location = "= "/cappuccino"" {
1072+
location = "/cappuccino" {
10731073
set $service "";
10741074
status_zone "";
10751075
rewrite /cappuccino /special/cappuccino break;
@@ -1163,7 +1163,7 @@ server {
11631163
11641164
11651165
1166-
location ~ "^~ "^/americano"" {
1166+
location ~ "^/americano" {
11671167
set $service "";
11681168
status_zone "";
11691169
proxy_http_version 1.1;
@@ -2081,7 +2081,7 @@ server {
20812081
set $resource_type "ingress";
20822082
set $resource_name "cafe-ingress";
20832083
set $resource_namespace "default";
2084-
location ~* "^~* "^/(latte|espresso)"" {
2084+
location ~* "^/(latte|espresso)" {
20852085
set $service "";
20862086
rewrite (?i)^/(latte|espresso) /drinks/$1 break;
20872087
proxy_http_version 1.1;
@@ -2118,7 +2118,7 @@ server {
21182118
set $resource_type "ingress";
21192119
set $resource_name "cafe-ingress";
21202120
set $resource_namespace "default";
2121-
location ~ "^~ "^/(coffee|tea)"" {
2121+
location ~ "^/(coffee|tea)" {
21222122
set $service "";
21232123
rewrite ^/(coffee|tea) /beverages/$1 break;
21242124
proxy_http_version 1.1;
@@ -2155,7 +2155,7 @@ server {
21552155
set $resource_type "ingress";
21562156
set $resource_name "cafe-menu-ingress";
21572157
set $resource_namespace "default";
2158-
location ~ "^~ "^/menu/(hot|cold)/(coffee|tea)"" {
2158+
location ~ "^/menu/(hot|cold)/(coffee|tea)" {
21592159
set $service "";
21602160
rewrite ^/menu/(hot|cold)/(coffee|tea) /drinks/$1/$2 break;
21612161
proxy_http_version 1.1;
@@ -2192,7 +2192,7 @@ server {
21922192
set $resource_type "ingress";
21932193
set $resource_name "cafe-ingress";
21942194
set $resource_namespace "default";
2195-
location = "= "/cappuccino"" {
2195+
location = "/cappuccino" {
21962196
set $service "";
21972197
rewrite /cappuccino /special/cappuccino break;
21982198
proxy_http_version 1.1;
@@ -2266,7 +2266,7 @@ server {
22662266
set $resource_type "ingress";
22672267
set $resource_name "cafe-ingress";
22682268
set $resource_namespace "default";
2269-
location ~ "^~ "^/americano"" {
2269+
location ~ "^/americano" {
22702270
set $service "";
22712271
proxy_http_version 1.1;
22722272
proxy_connect_timeout ;

internal/configs/version1/template_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3791,7 +3791,7 @@ func TestExecuteTemplate_ForIngressForNGINXRewriteTarget(t *testing.T) {
37913791
ServerTokens: "off",
37923792
Locations: []Location{
37933793
{
3794-
Path: "~ \"^/(coffee|tea)\"",
3794+
Path: "/(coffee|tea)",
37953795
RewriteTarget: "/beverages/$1",
37963796
Upstream: testUpstream,
37973797
},
@@ -3823,7 +3823,7 @@ func TestExecuteTemplate_ForIngressForNGINXRewriteTarget(t *testing.T) {
38233823
ServerTokens: "off",
38243824
Locations: []Location{
38253825
{
3826-
Path: "~* \"^/(latte|espresso)\"",
3826+
Path: "/(latte|espresso)",
38273827
RewriteTarget: "/drinks/$1",
38283828
Upstream: testUpstream,
38293829
},
@@ -3855,7 +3855,7 @@ func TestExecuteTemplate_ForIngressForNGINXRewriteTarget(t *testing.T) {
38553855
ServerTokens: "off",
38563856
Locations: []Location{
38573857
{
3858-
Path: "= \"/cappuccino\"",
3858+
Path: "/cappuccino",
38593859
RewriteTarget: "/special/cappuccino",
38603860
Upstream: testUpstream,
38613861
},
@@ -3918,7 +3918,7 @@ func TestExecuteTemplate_ForIngressForNGINXRewriteTarget(t *testing.T) {
39183918
ServerTokens: "off",
39193919
Locations: []Location{
39203920
{
3921-
Path: "~ \"^/americano\"",
3921+
Path: "/americano",
39223922
Upstream: testUpstream,
39233923
// RewriteTarget is empty - should not generate rewrite directive
39243924
},
@@ -3948,7 +3948,7 @@ func TestExecuteTemplate_ForIngressForNGINXRewriteTarget(t *testing.T) {
39483948
ServerTokens: "off",
39493949
Locations: []Location{
39503950
{
3951-
Path: "~ \"^/menu/(hot|cold)/(coffee|tea)\"",
3951+
Path: "/menu/(hot|cold)/(coffee|tea)",
39523952
RewriteTarget: "/drinks/$1/$2",
39533953
Upstream: testUpstream,
39543954
},
@@ -4027,7 +4027,7 @@ func TestExecuteTemplate_ForIngressForNGINXPlusRewriteTarget(t *testing.T) {
40274027
ServerTokens: "off",
40284028
Locations: []Location{
40294029
{
4030-
Path: "~ \"^/(coffee|tea)\"",
4030+
Path: "/(coffee|tea)",
40314031
RewriteTarget: "/beverages/$1",
40324032
Upstream: testUpstream,
40334033
},
@@ -4059,7 +4059,7 @@ func TestExecuteTemplate_ForIngressForNGINXPlusRewriteTarget(t *testing.T) {
40594059
ServerTokens: "off",
40604060
Locations: []Location{
40614061
{
4062-
Path: "~* \"^/(latte|espresso)\"",
4062+
Path: "/(latte|espresso)",
40634063
RewriteTarget: "/drinks/$1",
40644064
Upstream: testUpstream,
40654065
},
@@ -4091,7 +4091,7 @@ func TestExecuteTemplate_ForIngressForNGINXPlusRewriteTarget(t *testing.T) {
40914091
ServerTokens: "off",
40924092
Locations: []Location{
40934093
{
4094-
Path: "= \"/cappuccino\"",
4094+
Path: "/cappuccino",
40954095
RewriteTarget: "/special/cappuccino",
40964096
Upstream: testUpstream,
40974097
},
@@ -4154,7 +4154,7 @@ func TestExecuteTemplate_ForIngressForNGINXPlusRewriteTarget(t *testing.T) {
41544154
ServerTokens: "off",
41554155
Locations: []Location{
41564156
{
4157-
Path: "~ \"^/americano\"",
4157+
Path: "/americano",
41584158
Upstream: testUpstream,
41594159
// RewriteTarget is empty - should not generate rewrite directive
41604160
},
@@ -4184,7 +4184,7 @@ func TestExecuteTemplate_ForIngressForNGINXPlusRewriteTarget(t *testing.T) {
41844184
ServerTokens: "off",
41854185
Locations: []Location{
41864186
{
4187-
Path: "~ \"^/menu/(hot|cold)/(coffee|tea)\"",
4187+
Path: "/menu/(hot|cold)/(coffee|tea)",
41884188
RewriteTarget: "/drinks/$1/$2",
41894189
Upstream: testUpstream,
41904190
},

0 commit comments

Comments
 (0)