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

[resource_datadog_logs_index] Fix having zero retention logs indexes with flex #2716

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

Prepager
Copy link
Contributor

@Prepager Prepager commented Dec 11, 2024

Motivation

The resource currently has two issues:

  • On creation: You can not create an index with only flex retention and no standard retention defined.
  • On update: You can not remove the standard retention to have only the flex retention.

Changes

Context: While the endpoint is marked as a PUT it acts as a PATCH (docs)

On creation
If the resource has a flex_retention_days set, but no retention_days, it will default to 0 for retention_days.

On update
The previous GetOk check would turn 0 into null, making it impossible to remove the retention_days.
The new condition does an explicit IsNull check to allow through 0 values.

@Prepager Prepager marked this pull request as ready for review December 11, 2024 13:31
@Prepager Prepager requested review from a team as code owners December 11, 2024 13:31
Copy link

@arc013 arc013 left a comment

Choose a reason for hiding this comment

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

I'm doing a blind approval to not block you but I'm a little unsure why this change requires logs-forwarding's approval as it seems to be about index (which logs-forwarding team has close to zero context on).

@jack-edmonds-dd jack-edmonds-dd merged commit 1ebba65 into master Dec 13, 2024
20 of 21 checks passed
@jack-edmonds-dd jack-edmonds-dd deleted the andreas/logs-index-zero-retention-with-flex branch December 13, 2024 14:29
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.

5 participants