Skip to content

feat: Suppress diff for default value of memory_event: apply_type: "immediate"#573

Merged
maaarcelino merged 4 commits intomasterfrom
feat/suppress-apply-type-immediate
Sep 30, 2025
Merged

feat: Suppress diff for default value of memory_event: apply_type: "immediate"#573
maaarcelino merged 4 commits intomasterfrom
feat/suppress-apply-type-immediate

Conversation

@maaarcelino
Copy link
Copy Markdown
Contributor

No description provided.

@maaarcelino maaarcelino requested a review from a team as a code owner September 29, 2025 14:10

func suppressApplyTypeDefaultValueDiff(resource, oldValue, newValue string, d *schema.ResourceData) bool {
if isEmpty(newValue) {
applyType := d.Get(fmt.Sprintf("%s.0.%s", resource, FieldApplyType))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this will give you resource.apply_type, you probably want resource.memory_event.apply_type

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see resource has different meaning here. I don't think you need to pass it, just use FieldMemoryEvent

The reason why it was use in other function is that parent field is dynamic it can be either memory or cpu, in your case is static

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No because this translates into d.Get("memory_event.0.apply_type") of the scaling policy resource

@maaarcelino maaarcelino changed the title feat: Suppress defaulting to immediate apply type for memory events feat: Suppress diff for default value of memory_event: apply_type: immediate Sep 30, 2025
@maaarcelino maaarcelino changed the title feat: Suppress diff for default value of memory_event: apply_type: immediate feat: Suppress diff for default value of memory_event: apply_type: "immediate" Sep 30, 2025
@maaarcelino maaarcelino merged commit 571544a into master Sep 30, 2025
19 of 24 checks passed
@maaarcelino maaarcelino deleted the feat/suppress-apply-type-immediate branch September 30, 2025 08:11
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