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: ensure at least one of #74

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Conversation

tenthirtyam
Copy link
Contributor

@tenthirtyam tenthirtyam commented Jan 29, 2025

In order to have a good experience with our community, we recommend that you read the contributing guidelines for making a pull request.

Summary of Pull Request

Includes changes to the resource_vmc.go and vmc.md files to enforce that either sddc_name or sddc_id must be provided, but not both. These changes ensure proper validation and documentation for the VMware Cloud Services resource.

Validation improvements:

  • resource_vmc.go: Added ExactlyOneOf validation to enforce that either sddc_id or sddc_name must be provided. [1] [2]

Documentation updates:

  • vmc.md: Updated the argument reference to reflect that sddc_name and sddc_id are required, and added a note specifying that only one of them must be provided.

Type of Pull Request

  • This is a bug fix.
  • This is an enhancement or feature.
  • This is a code style/formatting update.
  • This is a documentation update.
  • This is a refactoring update.
  • This is a chore update
  • This is something else.
    Please describe:

Related to Existing Issues

Issue Number: N/A

Test and Documentation Coverage

For bug fixes or features:

  • Tests have been completed.
  • Documentation has been added/updated.
terraform validate
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - vmware/hcx in /Users/johnsonryan/go/bin
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
╷
│ Error: Invalid combination of arguments
│ 
│   with hcx_vmc.example,
│   on hcx.tf line 19, in resource "hcx_vmc" "example":
│   19:   sddc_name   = "example"
│ 
│ "sddc_name": only one of `sddc_id,sddc_name` can be specified, but `sddc_id,sddc_name` were specified.
╵
╷
│ Error: Invalid combination of arguments
│ 
│   with hcx_vmc.example,
│   on hcx.tf line 20, in resource "hcx_vmc" "example":
│   20:   sddc_id   = "example"
│ 
│ "sddc_id": only one of `sddc_id,sddc_name` can be specified, but `sddc_id,sddc_name` were specified.
╵

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

@tenthirtyam tenthirtyam added the technical-debt Technical Debt label Jan 29, 2025
@tenthirtyam tenthirtyam added this to the v0.6.0 milestone Jan 29, 2025
@tenthirtyam tenthirtyam self-assigned this Jan 29, 2025
@github-actions github-actions bot added needs-review Needs Review documentation Documentation labels Jan 29, 2025
@tenthirtyam tenthirtyam mentioned this pull request Jan 29, 2025
24 tasks
@tenthirtyam tenthirtyam requested a review from andybeltz January 29, 2025 18:26
Copy link

@andybeltz andybeltz left a comment

Choose a reason for hiding this comment

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

LGTM

@tenthirtyam tenthirtyam force-pushed the fix/ensure-mutual-exclusivity branch from 7321185 to ec403c2 Compare January 29, 2025 18:28
Adds use of `ExactlyOneOf` for `r/hcx_vmc` for `sddc_id` and `sddc_name` to ensure at least one of them is provided.

Signed-off-by: Ryan Johnson <[email protected]>
@tenthirtyam tenthirtyam force-pushed the fix/ensure-mutual-exclusivity branch from ec403c2 to 3048a91 Compare January 29, 2025 21:27
@tenthirtyam tenthirtyam changed the title fix: ensure mutual exclusivity fix: ensure at least one of Jan 29, 2025
@tenthirtyam tenthirtyam merged commit 85211ef into main Jan 29, 2025
7 checks passed
@tenthirtyam tenthirtyam deleted the fix/ensure-mutual-exclusivity branch January 29, 2025 21:30
@tenthirtyam tenthirtyam removed the needs-review Needs Review label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation technical-debt Technical Debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants