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

Fix tenant tags producing inconsistent result after apply after updating to plugin framework #817

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

mik-ky
Copy link
Collaborator

@mik-ky mik-ky commented Nov 18, 2024

Background
Our terraform provider creates invalid plans for a lot of the resources because we are using lists that are intended to be ordered. This is fine with other resources, because it is "tolerated because of the legacy plugin SDK".

There has been a recent update on this resource to use the newer terraform framework - and we no longer have this exemption. This PR addresses this.

Fixes #802

[sc-97302]

@mik-ky mik-ky force-pushed the fnm/fix-tenant_tags branch from 42dd214 to bfcfaf9 Compare November 18, 2024 21:18
@mik-ky mik-ky force-pushed the fnm/fix-tenant_tags branch from aab4453 to 2643e57 Compare November 18, 2024 21:37
Copy link
Contributor

@domenicsim1 domenicsim1 left a comment

Choose a reason for hiding this comment

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

Looks good overall, left a question

@@ -108,7 +108,7 @@ func (t TenantSchema) GetDatasourceSchema() datasourceSchema.Schema {
"id": GetIdDatasourceSchema(true),
"name": GetReadonlyNameDatasourceSchema(),
"space_id": GetSpaceIdDatasourceSchema("tenant", true),
"tenant_tags": datasourceSchema.ListAttribute{
"tenant_tags": datasourceSchema.SetAttribute{
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a migration for this or will existing configurations with lists already in state just handle swapping to set fine?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it does. Having said that, the existing configuration doesn't work at all, anyway. If they did use the workaround to sort the tags alphabetically on the resource, it should just work. The state files don't look any different to what it was before.

@mik-ky mik-ky merged commit e688aa7 into main Nov 19, 2024
22 checks passed
@mik-ky mik-ky deleted the fnm/fix-tenant_tags branch November 19, 2024 23:26
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.

octopusdeploy_tenant - Error: Provider produced inconsistent result after apply
2 participants