feat: add event to modify a service configuration before creation #1129
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.
Motivation
There is currently no event that allows to modify a service configuration on the node (via a module) to change the configuration when required. This can for example be setting process parameters or environment variables.
Modification
Add an event (
CloudServiceConfigurationPrePrepareEvent
) that holds the service configuration and the builder that is used to modify the service configuration in the cloud service factory. The event is called before the final modifications to the configuration are made (ensuring that the service id is only taken once, adding the templates, deployments, ... of the group components etc.). This ensures that no changes are made to the configuration which could potentially break the whole internal service handling.Result
The configuration of a service can be modified from a (head) node module.
Other context
Resolves #1074