Skip to content

fix: capture all fields of WorkspaceOwner when converting to cty.Value #82

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

Merged
merged 3 commits into from
Apr 15, 2025

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Apr 15, 2025

...so that terraform has access to all of the fields that it's supposed to!

@aslilac aslilac requested a review from Emyrk April 15, 2025 17:16
@Emyrk
Copy link
Member

Emyrk commented Apr 15, 2025

We might want to add something like this:

	if o.Groups == nil {
		o.Groups = make([]string, 0)
	}
	
	if o.RBACRoles == nil {
		o.RBACRoles = make([]WorkspaceOwnerRBACRole, 0)
	}

nil vs empty slice might behave differently when actually using the type in terraform.

@aslilac aslilac requested a review from Emyrk April 15, 2025 17:52
@aslilac
Copy link
Member Author

aslilac commented Apr 15, 2025

I already allocate a slice regardless of length for the roles. poking at the resulting object did reveal that not allocating a slice for groups causes problems, so I do that now as well.

@aslilac aslilac merged commit 1998a47 into main Apr 15, 2025
3 checks passed
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