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

Create a new Agent Policy for enrolling purposes #1799

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Apr 24, 2024

Part of #787
Relates elastic/integrations#9660

This PR creates a new Agent Policy just for enrolling purposes.

This allows us to create a new Agent Policy for the testing purpose where all the changes are set before assigning it to the agent (e.g. package data stream). Doing so, agent just receives one update (policy reassign) with the required changes for the testing.

@mrodm mrodm requested a review from a team April 24, 2024 15:16
@mrodm mrodm self-assigned this Apr 24, 2024
@mrodm mrodm changed the title Create enroll policy Create a new Agent Policy for enrolling purposes Apr 24, 2024
return fmt.Errorf("error cleaning up test policy: %w", err)
}
return nil
}

// policyToEnroll is used in both independent agents and agents created by servicedeployer (custom or kubernetes agents)
policy := policyToEnroll
if r.options.RunTearDown || r.options.RunTestsOnly {
Copy link
Member

Choose a reason for hiding this comment

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

Oh, more conditional logic here 🙈 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, another one 😅

@mrodm mrodm merged commit 78f4687 into elastic:main Apr 25, 2024
3 checks passed
@mrodm mrodm deleted the create_enroll_policy branch April 25, 2024 09:41
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.

2 participants