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

[datadog_api_key] Stop overwriting key values in state when the API omits the key #2544

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

tyjet
Copy link
Contributor

@tyjet tyjet commented Aug 28, 2024

When updating or importing API key resources, if the Datadog API does not include the optional computed key field, then the field is overwritten with an empty string in terraform state. The key is immutable so it does not need to be updated once it has been initially set.

Added a check to ensure the field is set before writing it into the response.

Tested manually via integration test against API responses with and without the key field. Updated unit test to match new behavior and not depend on the API returning an optional field.

@tyjet tyjet marked this pull request as ready for review August 28, 2024 15:03
@tyjet tyjet requested review from a team as code owners August 28, 2024 15:03
@tyjet tyjet changed the title Stop overwriting key values in state when the API omits the key. [datadog_api_key] Stop overwriting key values in state when the API omits the key. Aug 28, 2024
@tyjet tyjet changed the title [datadog_api_key] Stop overwriting key values in state when the API omits the key. [datadog_api_key] Stop overwriting key values in state when the API omits the key Aug 28, 2024
@jack-edmonds-dd
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in master is 1m.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2024

MergeQueue: This merge request is not mergeable, blocked by github

PR can't be merged according to github policy. It's probably because:

  • repository configuration requires approval by code owners, but no code owner approved this PR

If you need support, contact us on Slack #devflow with those details!

@jack-edmonds-dd
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in master is 1m.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2024

MergeQueue: This merge request is not mergeable, blocked by github

PR can't be merged according to github policy. It's probably because:

  • repository configuration requires approval by code owners, but no code owner approved this PR

If you need support, contact us on Slack #devflow with those details!

@jack-edmonds-dd
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in master is 1m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot deleted the david.diner/CRED-622 branch August 29, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants