Is your feature request related to a problem? Please describe.
Currently, NIC does not prevent the same VSR being used twice in the same VS, allowing specs that results in generating the same location block /coffee and the same upstream twice, which causes NGINX to trigger a "duplicate upstream" error upon reload:
which would result in the location block with the same path and upstreams with the same name vs_cafe_cafe_vsr_coffee_coffee_coffee generated in the NGINX config, resulting in the following reloading error
Warning AddedOrUpdatedWithError 11s nginx-ingress-controller Configuration for cafe/cafe was added or updated ; but was not applied: error when updating config from ConfigMap: nginx reload failed: command /usr/sbin/nginx -s reload -e stderr stdout: ""
stderr: "2024/10/08 08:30:19 [emerg] 42#42: duplicate upstream \"vs_cafe_cafe_vsr_coffee_coffee_coffee\" in /etc/nginx/conf.d/vs_cafe_cafe.conf:10\n"
Describe the solution you'd like
Disallow a VSR being used multiple times to prevent reload failure
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
This config error in obvious in the current specification where the VSRs is explicitly referenced in the VS spec. However, it might become less apparent in the future work #5293, where VSRs are associated with a VS through different methods.
Is your feature request related to a problem? Please describe.
Currently, NIC does not prevent the same VSR being used twice in the same VS, allowing specs that results in generating the same location block /coffee and the same upstream twice, which causes NGINX to trigger a "duplicate upstream" error upon reload:
Consider this VSR:
Currently, the following VS spec is allowed.
which would result in the location block with the same path and upstreams with the same name
vs_cafe_cafe_vsr_coffee_coffee_coffee
generated in the NGINX config, resulting in the following reloading errorDescribe the solution you'd like Disallow a VSR being used multiple times to prevent reload failure
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context This config error in obvious in the current specification where the VSRs is explicitly referenced in the VS spec. However, it might become less apparent in the future work #5293, where VSRs are associated with a VS through different methods.