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

Remove source file and datadog-signing-keys package when removing the Agent #865

Merged
merged 13 commits into from
Dec 7, 2022

Conversation

amenasria
Copy link
Contributor

@amenasria amenasria commented Nov 10, 2022

This PR fixes #847 .

This PR also adds some tests to check that once deleting the Agent, the source file and the datadog-signing-keys package are also removed from the host.

@amenasria amenasria requested a review from a team as a code owner November 10, 2022 16:55
@amenasria amenasria marked this pull request as draft November 10, 2022 16:56
@amenasria amenasria marked this pull request as ready for review December 6, 2022 13:50
Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

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

Hey 👋 this mostly looks good, but I left some minor comments to address. Thanks!

@@ -7,6 +7,11 @@ class << self
datadog-iot-agent
].freeze

# This method stores a variable that is used across recipes so we needed a place to define it
Copy link
Contributor

Choose a reason for hiding this comment

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

Another potential place to store a variable like this might be https://github.com/DataDog/chef-datadog/blob/main/attributes/default.rb, but that would also mean users could change it, which we don't want, so I think it's ok to have it defined here. Perhaps you could expand this comment to note the reason why this is not in default.rb?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, that'd be clearer ! Fixed in 399a428.


# Then remove the installation files (depending on the OS: sources_list file, datadog-signing-keys package...)
case node['platform_family']
when 'amazon', 'rhel' # 'rhel' includes redhat, centos, rocky, scientific and almalinux
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're missing fedora here, this should match https://github.com/DataDog/chef-datadog/blob/main/recipes/repository.rb#L165

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot to put it back, mb ! Fixed in 5c87ee8.

@amenasria amenasria requested a review from bkabrda December 7, 2022 10:07
@amenasria amenasria merged commit d98bec5 into main Dec 7, 2022
@amenasria amenasria deleted the amenasria/remove-repo-files-during-deletion branch December 7, 2022 12:17
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.

remove_dd_agent recipe does not remove the apt source nor datadog-signing-keys package
2 participants