-
Notifications
You must be signed in to change notification settings - Fork 520
Merge multiple ingresses with the same name from different includes #1460
Comments
I see, you want to do a config merge. I'm not sure this should just work, maybe this needs to be declared "partial" in order to allow the merge. We need to be able to distinguish the error case (oops I didn't mean to overwrite) from the merge case. |
@davidfowl what happens without this PR, is that it throws an exception for the second ingress it finds:
and if you give them a unique name:
Your suggestion is to keep throwing these exception (or another one) unless you explicitly say they can be merged? name: myenv
ingress:
- name: ingress
allowIncludeRules: true
bindings:
- port: 80
ip: "*"
protocol: http
services:
- name: myauthservice
include: .\myauthserice\tye.yaml
- name: blazorappweb
include: .\blazorappweb\tye.yaml
I don't think much harm could be done by adding rules to the same ingress though. Or are you more concerned about overwring the bindings? We could also throw an exception if the name matches but the bindings don't -> InvalidConfigurationException: "A conflict between the ingresses in myauthservice and blazorappweb has been found. The name of the ingresses are the same, but the bindings are not"
So we have a option 1: add extra property to ingress to allow 'sub-rules' I prefer option 2, only throw an exception with conflicting rules |
I added exceptions for the conflict situations and added unittests for non-conflict and conflict situation |
What should we add or change to make your life better?
If we include multiple tye files from 1 main tye file, we cannot easily add ingresses on the same port atm.
Take this as an example:
main tye.yaml:
.\myauthserice\tye.yaml:
\blazorappweb\tye.yaml:
Now if you try to startup the main tye file, you'll get an exception that 'ingress' is already added to the services dictionary in ApplicationBuilderExtensions.ToHostingApplication
If you give them a unique name, tye tries to startup 2 webhosts with the same binding, resulting in a port is already in use exception.
Specifying 1 ingress in the main file is also not possible, since the validator checks if the ingress points to an existing service in the same file, but the actual service where it should point to isn't in the same file
But having the ingress defined in the own tye files seems better to me anyway, so the can also run standalone.
Why is this important to you?
To have tye list on 1 port and and ip and serve all loaded services from that port based on domain-name
The text was updated successfully, but these errors were encountered: