Fix bug when changing the Filebeat URL in the Installation Assistant #3110
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.
Description
When checking if the Filebeat URL was valid, if it wasn't, it was replaced with a valid URL. However, this change was never included in the
wazuh-install.sh
because the function was called after the content had already been written to thewazuh-install.sh
. Additionally, when evaluating the URL, it was being evaluated using thesource_branch
variable from the file where it was being evaluated, in this case, frombuilder.sh
, when it should have used the one from theinstallVariables.sh
file.To solve the first issue, it was simply necessary to change the position of the function since it was executed at the end, after adding the content to the
wazuh-install.sh
, and therefore it didn't capture any possible changes that might have been made.The second issue was resolved by evaluating the necessary variables from installVariables.sh. In this case,
wazuh_version
and source_branch. To avoid overwriting thesource_branch
value frombuilder.sh
, it was renamed with a different name. This way, when the Filebeat URL is evaluated, it will use the correct source_branch value.Tests