Check/get ingress port on add-on load #4744
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
Instead of setting the ingress port on install, make sure to set the port when the add-on gets loaded (on Supervisor startup and before installation). This is necessary since a dynamic ingress port is not stored as part of the add-on data storage themself but in the ingress data store. So on every Supervisor start the port needs to be transferred to the add-on model.
Note that we still need to check the port on add-on update since the add-on potentially added (dynamic) ingress on update. Same applies to add-on restore (the restored version might use a dynamic ingress port).
This addresses the following issue seen on the dev channel:
Type of change
Additional information
Checklist
black --fast supervisor tests
)If API endpoints of add-on configuration are added/changed: