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

Add an overload of ReassignProxyRequest that accepts both route and cluster #1752

Closed
asgeirn opened this issue Jun 3, 2022 Discussed in #1749 · 2 comments
Closed

Add an overload of ReassignProxyRequest that accepts both route and cluster #1752

asgeirn opened this issue Jun 3, 2022 Discussed in #1749 · 2 comments
Labels
help wanted We will welcome a contribution Type: Enhancement New feature or request

Comments

@asgeirn
Copy link

asgeirn commented Jun 3, 2022

Discussed in #1749

Originally posted by asgeirn June 2, 2022
Hi!

I'm attempting using Unleash feature toggles to reassign proxy requests as described in https://microsoft.github.io/reverse-proxy/articles/ab-testing.html

However, the proxy route contains a PathSet tranform, and even if i reassign the proxy request to another cluster, this transform is still applied.

Is there a way to disable this transform for the request when I reassign the request to another cluster?

Assigning both route and cluster when reassigning proxy request worked for me, this is the actual code I used instead of ReassignProxyRequest, with both route and cluster retrieved from IProxyStateLookup:

    var oldFeature = context.GetReverseProxyFeature();
    var destinations = cluster.DestinationsState;
    var newFeature = new ReverseProxyFeature()
    {
        Route = route,
        Cluster = cluster.Model,
        AllDestinations = destinations.AllDestinations,
        AvailableDestinations = destinations.AvailableDestinations,
        ProxiedDestination = oldFeature.ProxiedDestination,
    };
    context.Features.Set<IReverseProxyFeature>(newFeature);
@karelz karelz added this to the YARP 2.0.0 milestone Jun 7, 2022
@karelz
Copy link
Member

karelz commented Jun 7, 2022

Triage: We should be able to add an overload.
Should be simple - anyone interested in a contribution?

@karelz karelz added Type: Enhancement New feature or request help wanted We will welcome a contribution labels Jun 7, 2022
@latelylk
Copy link
Contributor

anyone interested in a contribution?

Just an overload for ReassignProxyRequest that accepts route in addition to cluster? If so, I'd like to take this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We will welcome a contribution Type: Enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

4 participants