Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#IOPLT-228] - Remove routing to AKS beta cluster #722

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<policies>
<inbound>
<base />
<choose>
<set-backend-service base-url="https://weuprod01.messages.internal.io.pagopa.it/io-backend/api/v1" />
<!-- <choose>
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("beta"))">
<set-backend-service base-url="https://weubeta.messages.internal.io.pagopa.it/io-backend/api/v1" />
</when>
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("weu-prod01"))">
<set-backend-service base-url="https://weuprod01.messages.internal.io.pagopa.it/io-backend/api/v1" />
</when>
<otherwise>
<!-- https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32) -->
https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32)
<set-variable name="urlWeight" value="@{
Random rnd = new Random();
int urlWeight = rnd.Next(1, 1001);
Expand All @@ -35,7 +36,7 @@
</otherwise>
</choose>
</otherwise>
</choose>
</choose> -->
<set-header name="x-user-groups" exists-action="override">
<value>@(String.Join(",", context.User.Groups.Select(g => g.Name)))</value>
</set-header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<policies>
<inbound>
<base />
<choose>
<set-backend-service base-url="https://weuprod01.messages.internal.io.pagopa.it/service-messages/api/v1" />
<!-- <choose>
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("beta"))">
<set-backend-service base-url="https://weubeta.messages.internal.io.pagopa.it/service-messages/api/v1" />
</when>
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("weu-prod01"))">
<set-backend-service base-url="https://weuprod01.messages.internal.io.pagopa.it/service-messages/api/v1" />
</when>
<otherwise>
<!-- https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32) -->
https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32)
<set-variable name="urlWeight" value="@{
Random rnd = new Random();
int urlWeight = rnd.Next(1, 1001);
Expand All @@ -35,7 +36,7 @@
</otherwise>
</choose>
</otherwise>
</choose>
</choose> -->
<set-header name="x-user-groups" exists-action="override">
<value>@(String.Join(",", context.User.Groups.Select(g => g.Name)))</value>
</set-header>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
<policies>
<inbound>
<base />
<choose>
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" />
<!-- <choose>
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("beta"))">
<set-backend-service base-url="https://weubeta.payments.internal.io.pagopa.it/api/v1/payment" />
</when>
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("weu-prod01"))">
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" />
</when>
<otherwise>
<!-- https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32) -->
# https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32)
<set-variable name="urlWeight" value="@{
Random rnd = new Random();
int urlWeight = rnd.Next(1, 1001);
return urlWeight;}" />
<choose>
<when condition="@(context.Variables.GetValueOrDefault
<int>("urlWeight")
<= 1)">
<set-backend-service base-url="https://weubeta.payments.internal.io.pagopa.it/api/v1/payment" />
</when>
<when condition="@(context.Variables.GetValueOrDefault
<int>("urlWeight") > 1)">
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" />
</when>
<otherwise>
<return-response>
<set-status code="500" reason="InternalServerError" />
<set-header name="Microsoft-Azure-Api-Management-Correlation-Id" exists-action="override">
<value>@{return Guid.NewGuid().ToString();}</value>
</set-header>
<set-body>A gateway-related error occurred while processing the request.</set-body>
</return-response>
</otherwise>
</choose>
</otherwise>
</choose>
</inbound>
<outbound>
<base />
</outbound>
<backend>
<base />
</backend>
<on-error>
<base />
</on-error>
</policies>
<int>("urlWeight")
<= 1)">
<set-backend-service base-url="https://weubeta.payments.internal.io.pagopa.it/api/v1/payment" />
</when>
<when condition="@(context.Variables.GetValueOrDefault
<int>("urlWeight") > 1)">
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" />
</when>
<otherwise>
<return-response>
<set-status code="500" reason="InternalServerError" />
<set-header name="Microsoft-Azure-Api-Management-Correlation-Id" exists-action="override">
<value>@{return Guid.NewGuid().ToString();}</value>
</set-header>
<set-body>A gateway-related error occurred while processing the request.</set-body>
</return-response>
</otherwise>
</choose>
</otherwise>
</choose> -->
</inbound>
<outbound>
<base />
</outbound>
<backend>
<base />
</backend>
<on-error>
<base />
</on-error>
</policies>