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

map empty certificate filter lists to null lists #43

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

swgillespie
Copy link
Collaborator

Terraform considers the null list and the empty list to be two separate values, in the same way that Go does. To ensure consistency, this commit explicitly transforms missing certificate filter lists into null lists in both directions (TF -> API and API -> TF).

Fixes this issue:

│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to temporalcloud_namespace.terraform, provider "provider[\"registry.terraform.io/hashicorp/temporalcloud\"]"
│ produced an unexpected new value: .certificate_filters: was null, but now
│ cty.ListValEmpty(cty.Object(map[string]cty.Type{"common_name":cty.String, "organization":cty.String,
│ "organizational_unit":cty.String, "subject_alternative_name":cty.String})).
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Terraform considers the null list and the empty list to be two separate values, in the same way that Go does. To ensure consistency, this commit explicitly transforms missing certificate filter lists into null lists in both directions (TF -> API and API -> TF).

Fixes this issue:

```
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to temporalcloud_namespace.terraform, provider "provider[\"registry.terraform.io/hashicorp/temporalcloud\"]"
│ produced an unexpected new value: .certificate_filters: was null, but now
│ cty.ListValEmpty(cty.Object(map[string]cty.Type{"common_name":cty.String, "organization":cty.String,
│ "organizational_unit":cty.String, "subject_alternative_name":cty.String})).
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
```
@swgillespie swgillespie requested a review from a team as a code owner January 19, 2024 20:49
Copy link
Contributor

@tminusplus tminusplus left a comment

Choose a reason for hiding this comment

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

Did you get an account / api key setup for the CI/CD tests? If not I can help out with that too.

// New namespace with retention of 7
Config: config("terraform-test", 7),
},
/* Does not work yet: CLD-1971
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@swgillespie
Copy link
Collaborator Author

Did you get an account / api key setup for the CI/CD tests? If not I can help out with that too.

Not yet! Still interested in doing this.

@swgillespie swgillespie merged commit 39f002c into main Jan 22, 2024
6 of 16 checks passed
@swgillespie swgillespie deleted the swgillespie/empty-certfilters branch January 22, 2024 18:32
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