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

Add method to list variable sets by workspace #520

Closed

Conversation

tstapler
Copy link
Contributor

Description

The Variable Sets api supports listing VariableSets using a WorkspaceID. This is useful if you only want to select the VariableSets used by an API.

Testing plan

  1. Create a Workspace and add a Variable set to it.
  2. Call ListForWorkspace using the workspaceID.

External links

https://www.terraform.io/enterprise/api-docs/variable-sets#list-variable-set

@tstapler tstapler requested a review from a team as a code owner August 30, 2022 20:05
@hashicorp-cla
Copy link

hashicorp-cla commented Aug 30, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@sebasslash sebasslash left a comment

Choose a reason for hiding this comment

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

👋 Thanks for your contribution, Tyler 🔥. While your changes are great, this method belongs in the Workspaces interface: client.Workspaces.ListVariableSets()

variable_set.go Show resolved Hide resolved
ctx := context.Background()

orgTest, orgTestCleanup := createOrganization(t, client)
defer orgTestCleanup()
Copy link
Contributor

Choose a reason for hiding this comment

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

Use t.Cleanup(orgTestCleanup) in favor of defer.

@sebasslash
Copy link
Contributor

Your changes have been merged in #552. Thank you for your contribution!

@sebasslash sebasslash closed this Oct 20, 2022
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.

None yet

3 participants