Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add tag category validation #1602

Merged
merged 3 commits into from
Feb 24, 2022
Merged

Add tag category validation #1602

merged 3 commits into from
Feb 24, 2022

Conversation

appilon
Copy link
Contributor

@appilon appilon commented Feb 24, 2022

Description

Perform runtime validation of tag category associable types (since validate funcs don't work on aggregate types)

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

➜ make testacc TESTARGS='-run=TestAccResourceVSphereTagCategory_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccResourceVSphereTagCategory_ -timeout 240m
?   	github.com/hashicorp/terraform-provider-vsphere	[no test files]
=== RUN   TestAccResourceVSphereTagCategory_basic
--- PASS: TestAccResourceVSphereTagCategory_basic (27.80s)
=== RUN   TestAccResourceVSphereTagCategory_addType
--- PASS: TestAccResourceVSphereTagCategory_addType (38.78s)
=== RUN   TestAccResourceVSphereTagCategory_removeTypeShouldError
--- PASS: TestAccResourceVSphereTagCategory_removeTypeShouldError (29.45s)
=== RUN   TestAccResourceVSphereTagCategory_invalidTypeShouldError
--- PASS: TestAccResourceVSphereTagCategory_invalidTypeShouldError (14.07s)
=== RUN   TestAccResourceVSphereTagCategory_rename
--- PASS: TestAccResourceVSphereTagCategory_rename (35.05s)
=== RUN   TestAccResourceVSphereTagCategory_singleCardinality
--- PASS: TestAccResourceVSphereTagCategory_singleCardinality (21.97s)
=== RUN   TestAccResourceVSphereTagCategory_multiCardinality
--- PASS: TestAccResourceVSphereTagCategory_multiCardinality (24.10s)
PASS

Release Note

Release note for CHANGELOG:

`resource/tag_category`: Perform validation of associable types and update documentation around "All" which never worked.

References

Closes #1445

attribute will now error if incorrect type is listed, also remove mention of "All"
as it never appeared to work.
@github-actions github-actions bot added documentation Type: Documentation provider Type: Provider size/m Relative Sizing: Medium labels Feb 24, 2022
@appilon appilon added this to the v2.1.0 milestone Feb 24, 2022
@tenthirtyam tenthirtyam added needs-review Status: Pull Request Needs Review area/tagging Area: Tagging labels Feb 24, 2022
Copy link
Collaborator

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

I added comments regarding including constants for each type (but it's not a requirement) and future methods to consider that could mask the API (e.g. com.vmware.content.library.Item) from the user with simpler terms.

vsphere/tags_helper.go Show resolved Hide resolved
website/docs/r/tag_category.html.markdown Show resolved Hide resolved
@appilon appilon merged commit e1a956b into master Feb 24, 2022
@appilon appilon deleted the gh-1445 branch February 24, 2022 18:28
@tenthirtyam tenthirtyam removed the needs-review Status: Pull Request Needs Review label Feb 24, 2022
@github-actions
Copy link

github-actions bot commented Mar 2, 2022

This functionality has been released in v2.1.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Apr 2, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/tagging Area: Tagging documentation Type: Documentation provider Type: Provider size/m Relative Sizing: Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vsphere_tag_category incorrectly parses alias for associable_types = ["All"]
3 participants