apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

bug(fe): route created with service can not use the service upstream

Open liuxiran opened this issue 5 years ago • 10 comments

Bug report

Describe the bug

Refer to the description, when create a route with service id, this route will have the same upstream and plugin configuration.

When I try to create a route with service in dashboard, although I have selected a service in the first step, I still have to define a newupstream because of the required validation in the second step, and at the same time, the new upstream definition will cover the service's upstream.

How to Reproduce

  1. create a service
  2. create a route, select the service in the first step, click Next button
  3. in the second step, we have to define the upstream

Expected behavior

I would be better to use service data to auto fill in the upstream form in the second step.

System information

  • OS: Fedora 32
  • Browser (if applies) Chrome
  • Version: master branch

liuxiran avatar Jan 13 '21 02:01 liuxiran

Creating Route needs to be updated according to [1], please take a look.

image

[1] https://github.com/apache/apisix-dashboard/issues/1213

juzhiyuan avatar Jan 13 '21 02:01 juzhiyuan

ping

juzhiyuan avatar Jan 14 '21 07:01 juzhiyuan

Creating Route needs to be updated according to [1], please take a look.

image

[1] #1213

Got it, so IMHO, when create a route with a service, we need to :

  1. auto fill in the upstream with the service's upstream info
  2. user can also specify difference upstream according to their requirements

what do you think? @juzhiyuan @LiteSun @idbeta

liuxiran avatar Jan 14 '21 08:01 liuxiran

Got it, so IMHO, when create a route with a service, we need to :

  1. auto fill in the upstream with the service's upstream info
  2. user can also specify difference upstream according to their requirements

what do you think? @juzhiyuan @LiteSun @idbeta

Agree, but the option of specify difference upstream should not be necessary. @membphis

idbeta avatar Jan 14 '21 08:01 idbeta

Hi @liuxiran, specify different upstream is a historical legacy 🤔 not sure if we should remove this part in the future, only allow users to bind an upstream or a service.

juzhiyuan avatar Jan 14 '21 08:01 juzhiyuan

Thanks for your reply @juzhiyuan @idbeta .

so when create a route with a service, we only need to auto fill in the upstream with the service upstream info, and at the same time, user could not specify it, am I right?

liuxiran avatar Jan 14 '21 09:01 liuxiran

Once we auto fill upstream info from service, a new upstream object would be bound to that route unexpectedly IMO ⚠️

juzhiyuan avatar Jan 14 '21 09:01 juzhiyuan

Once we auto fill upstream info from service, a new upstream object would be bound to that route unexpectedly IMO

you mean we should omit the upstream in the request body, right? Ok, got it, it is the same as mentioned in the https://github.com/apache/apisix/blob/master/doc/architecture-design.md#service.

~I just assigned myself, and the pr will be opened later this week^_^~

liuxiran avatar Jan 14 '21 09:01 liuxiran

When I tried to create a route with service_id, None select option would add to the select_upstream, but I could still custom the upstream

image

image

this result seems not meet my expectation, so I wonder if it is intentional or it still needs to improve?

cc @LiteSun @juzhiyuan

liuxiran avatar Jan 24 '21 12:01 liuxiran

Service or Upstream is an entity for Route, because the older dashboard supports custom upstream, and the upstream data is stored but not linked or referenced in etcd, once we omit upstream after selecting service, some unexpected issues would happen.

But we could support after service is selected, upstream turns to be optional 🤔 Does it make sense to your concern? Let me know if not 😄

juzhiyuan avatar Jan 24 '21 13:01 juzhiyuan