Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle agent centralized configuration commands #223

Merged

Conversation

jr0me
Copy link
Member

@jr0me jr0me commented Oct 15, 2024

Related issue
#222

Description

This PR introduces a CentralizedConfiguration class that will handle the incoming set-group and update-group commands.

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X

@jr0me jr0me linked an issue Oct 15, 2024 that may be closed by this pull request
@jr0me jr0me force-pushed the enhancement/32-agent-centralized-configuration-class-mvp branch from 64cea84 to 0d51b92 Compare October 16, 2024 12:21
@jr0me jr0me marked this pull request as ready for review October 16, 2024 12:39
@jr0me jr0me self-assigned this Oct 16, 2024
@jr0me jr0me linked an issue Oct 16, 2024 that may be closed by this pull request
@jr0me jr0me force-pushed the enhancement/32-agent-centralized-configuration-class-mvp branch from 0d51b92 to 64a6b96 Compare October 17, 2024 22:05
At the moment just Start, Stop and Name.

This class will not be performing any specific actions on
start and stop, at least for this PR.
@jr0me jr0me force-pushed the enhancement/32-agent-centralized-configuration-class-mvp branch from 9b4a2bb to 9530c70 Compare October 18, 2024 14:09
It's not necessary to set any configuration at the moment
They are included and used in its public header
It's currently a placeholder for the future implementation
This commit adds a new method, SetGroupIdFunction,
to the CentralizedConfiguration class. This method allows the
user to set a function that takes a vector of integers as input
and returns a boolean value. The function is used to set the
group ID in the CentralizedConfiguration module.

If the function returns true, the group ID is set successfully,
otherwise, it returns a failure status.

The SetGroupIdFunction method is implemented in the
CentralizedConfiguration class and takes a std::function object
as input.

This function can be used to perform custom logic for setting
the group ID.

This commit also includes a test case which verifies that the
SetGroupIdFunction method is called and returns the correct result.
This function is used for the update-group command,
which will fetch the groups the agent belongs to,
download their configuration files, and apply them.
The ModuleManager imposes this requirement, although it
doesn't need it.
@jr0me jr0me force-pushed the enhancement/32-agent-centralized-configuration-class-mvp branch from 9530c70 to 9e3bc20 Compare October 18, 2024 14:52
Copy link
Member

@cborla cborla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cborla cborla merged commit 3dd96a6 into master Oct 18, 2024
5 checks passed
@cborla cborla deleted the enhancement/32-agent-centralized-configuration-class-mvp branch October 18, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent centralized configuration Agent centralized configuration: implement CentralizedConfiguration class
4 participants