-
Notifications
You must be signed in to change notification settings - Fork 260
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
Update _install-windows.rb #934
base: main
Are you sure you want to change the base?
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.
Opened issue for this bug: #935 |
And you might want to update your ci pipelines :) |
👋 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! |
@mwijers DataDog/puppet-datadog-agent#819 was merged, could you rebase your changes so that the CI can run on your changes? |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ question: Is this still necessary given that run_state
always gets discarded at the end of the Chef Infra Client run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about node.run_state
- that's a much more appropriate location for the transient Datadog user credentials. Thank you for the PR!
I'd be happy to help get it merged once you rebase your changes on main and the CI passes.
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.