Changed command order execution to get the TOKEN #57
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
Related: #51
Complementary PR of: #52
The aim of this PR is to change the order of the token API fetch in the
manager_checkService
function. Now, the function will do the following:This PR was originated to fix the following behavior: if the API was not ready to receive requests, the TOKEN variable was empty, and in case the Wazuh manager node was a worker, the credentials were not changed. Then, the TOKEN could not be fetched: https://github.com/wazuh/wazuh-installation-assistant/actions/runs/10832984133/job/30058653961
Note
Notice that, in the mentioned GHA run, one of the worker nodes could get the TOKEN, but the other one couldn't because of the mentioned behavior
This PR changes the order in which these commands are executed:
Invalid credentials
value. In another case, the TOKEN would be correctly fetched.Invalid credentials
value, the credentials are changed and the TOKEN is requested again, with the correct credentials, and also, ensuring that the API is ready.Testing
The testing was performed using the GHAs: