Open
Conversation
Prevent an issue (race condition) where Windows environment is locked by another process causing hanging chef-client runs during writing or removing the dd username or password using windows_env. Changed the logic to node.run_state which prevents this condition and also makes sure the password isn't stored n cleartext in the environment variables.
Author
|
Opened issue for this bug: #935 |
Author
|
And you might want to update your ci pipelines :) |
Contributor
|
👋 Thanks for your contribution, it's much appreciated! The CI is affected by the same issue as for the Puppet module: DataDog/puppet-datadog-agent#819 Thanks for your patience! |
Contributor
|
@mwijers DataDog/puppet-datadog-agent#819 was merged, could you rebase your changes so that the CI can run on your changes? |
julien-lebot
reviewed
Jan 7, 2025
Comment on lines
32
to
+37
| def clean_user(context) | ||
| resource = context.resource_collection.lookup('windows_env[DDAGENTUSER_NAME]') | ||
| resource.run_action(:delete) | ||
| context.node.run_state['datadog']['windows_ddagentuser_name'] = nil | ||
| end | ||
|
|
||
| def clean_password(context) | ||
| resource = context.resource_collection.lookup('windows_env[DDAGENTUSER_PASSWORD]') | ||
| resource.run_action(:delete) | ||
| context.node.run_state['datadog']['windows_ddagentuser_password'] = nil |
Contributor
There was a problem hiding this comment.
❓ question: Is this still necessary given that run_state always gets discarded at the end of the Chef Infra Client run?
julien-lebot
approved these changes
Jan 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prevent an issue (race condition) where Windows environment is locked by another process causing hanging chef-client runs during writing or removing the dd username or password using windows_env. Changed the logic to node.run_state which prevents this condition and also makes sure the password isn't stored n cleartext in the environment variables.