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

Update _install-windows.rb #934

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update _install-windows.rb #934

wants to merge 2 commits into from

Conversation

mwijers
Copy link

@mwijers mwijers commented Dec 20, 2024

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.

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.
@mwijers
Copy link
Author

mwijers commented Dec 20, 2024

Opened issue for this bug: #935

@mwijers
Copy link
Author

mwijers commented Dec 20, 2024

And you might want to update your ci pipelines :)

@julien-lebot
Copy link
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
@DataDog/container-ecosystems is now responsible for this repo, and they plan to tackle this issue very soon.

Thanks for your patience!

@julien-lebot
Copy link
Contributor

@mwijers DataDog/puppet-datadog-agent#819 was merged, could you rebase your changes so that the CI can run on your changes?

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
Copy link
Contributor

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?

Copy link
Contributor

@julien-lebot julien-lebot left a 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.

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