bug(fe): route created with service can not use the service upstream
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
- create a service
- create a route, select the service in the first step, click
Nextbutton - 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
Creating Route needs to be updated according to [1], please take a look.

[1] https://github.com/apache/apisix-dashboard/issues/1213
ping
Creating Route needs to be updated according to [1], please take a look.
[1] #1213
Got it, so IMHO, when create a route with a service, we need to :
- auto fill in the upstream with the service's upstream info
- user can also specify difference upstream according to their requirements
what do you think? @juzhiyuan @LiteSun @idbeta
Got it, so IMHO, when create a route with a service, we need to :
- auto fill in the upstream with the service's upstream info
- 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
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.
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?
Once we auto fill upstream info from service, a new upstream object would be bound to that route unexpectedly IMO ⚠️
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^_^~
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


this result seems not meet my expectation, so I wonder if it is intentional or it still needs to improve?
cc @LiteSun @juzhiyuan
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 😄