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

Don't make project id computed #43

Closed
wants to merge 1 commit into from

Conversation

michaeljguarino
Copy link
Member

@michaeljguarino michaeljguarino commented Jun 21, 2024

this also borks annoyingly, the core thing we're trying to avoid is having a detected upstream project id causing a full replacement of the cluster resource

this also borks annoyingly
@michaeljguarino michaeljguarino added bug Something isn't working hotfix labels Jun 21, 2024
@michaeljguarino
Copy link
Member Author

@maciaszczykm can you test this?

@maciaszczykm
Copy link
Member

@michaeljguarino Terraform produces an error when project ID is left empty:

╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to plural_cluster.byok, provider "provider[\"registry.terraform.io/pluralsh/plural\"]" produced an unexpected new value: .project_id: was null, but now
│ cty.StringVal("c7c6efda-dfb2-4085-8bed-f7062eb11431").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

It happens because if project is not set API defaults it, then we read it to put it in Terraform state. Terraform does not allow providers returning theirs own values if attributes are not Computed.

The workaround can be not reading project at all. Then if user leaves it empty it wouldn't be loaded from API and in state it would be empty. If this is acceptable then we should remove mappings in internal/resource/cluster_model.go:115 and internal/resource/cluster_model.go:129.

I also have one comment related to PROD-2304 which I left in Linear. I think if we will not require replace it might be confusing for users as changing it after first apply would not reflect the change in the resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hotfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants