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

U-4293 Catalog and Policies v3 tweaks #138

Merged
merged 4 commits into from
Jan 31, 2025
Merged

U-4293 Catalog and Policies v3 tweaks #138

merged 4 commits into from
Jan 31, 2025

Conversation

PetrHeinz
Copy link
Member

@PetrHeinz PetrHeinz commented Jan 30, 2025

The was an issue with the computed optional metadata value fields item_id, email, and name:

When you saved {type:"User",email:"foo@example.com"}, you would get item_id and name in the response, saving it into state.
This extra state would get saved.
When chasing that value to {type:"String",value:"my string"}, the previously saved item_id and name would be send alongside.

I tried to overcome this issue, but haven't found a way to distinguish the computed optional values from human-configured values.

My solution here is to remove the Computed flag from these fields, and prevent saving the values from API. If this wasn't prevented, the plan after applying would always include the attempt to remove the item_id and name from the value, making the plan unstable.

Fixes both #136 and #137

@PetrHeinz PetrHeinz requested a review from adikus January 31, 2025 14:28
Copy link
Contributor

@adikus adikus left a comment

Choose a reason for hiding this comment

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

Thanks! A bit of a shame that this is necessary 🙈

@PetrHeinz
Copy link
Member Author

@adikus I was trying to avoid it, but haven't found a way. In newer version of Terraform there are some features that might be helpful, but that would mean dropping support for a lot of previous versions, and I didn't want ot commit to that.

@PetrHeinz PetrHeinz merged commit e9ff404 into master Jan 31, 2025
25 checks passed
@PetrHeinz PetrHeinz deleted the ph/metadata-tweaks branch January 31, 2025 14:36
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