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

Improper Error message for missing SDDC info #238

Open
4 tasks done
pradeep17j opened this issue Sep 17, 2024 · 2 comments · May be fixed by #239
Open
4 tasks done

Improper Error message for missing SDDC info #238

pradeep17j opened this issue Sep 17, 2024 · 2 comments · May be fixed by #239
Assignees
Labels
bug Bug
Milestone

Comments

@pradeep17j
Copy link

Code of Conduct

  • I have read and agree to the Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

v1.7.2

Terraform Provider

0.9.1

VMware Cloud Foundation

v5.0

Description

When SDDC information is not provided while creating resource vcf_domain , the error message complains about missing
Cloud builder information .
The error message should have been about missing SDDC info

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Invalid provider configuration
│
│ Provider "registry.terraform.io/vmware/vcf" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.
│
╵
╷
│ Error: CloudBuilder username, password and host must be provided
│
│   with provider["registry.terraform.io/vmware/vcf"],
│   on <empty> line 0:
│   (source code not available)

Affected Resources or Data Sources

resource/vcf_domain

Terraform Configuration

provider.tf file without provider vcf{} block

Debug Output

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Invalid provider configuration
│
│ Provider "registry.terraform.io/vmware/vcf" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.
│
╵
╷
│ Error: CloudBuilder username, password and host must be provided
│
│   with provider["registry.terraform.io/vmware/vcf"],
│   on <empty> line 0:
│   (source code not available)

Panic Output

No response

Expected Behavior

Complains about missing Cloud builder information

Actual Behavior

Should have mentioned about missing SDDC manager information

Steps to Reproduce

terraform plan with out provider vcf { } block in provider.tf file

Environment Details

No response

Screenshots

No response

References

No response

@pradeep17j pradeep17j added bug Bug needs-triage Needs Triage labels Sep 17, 2024
@github-actions github-actions bot added the pending-review Pending Review label Sep 17, 2024
@tenthirtyam tenthirtyam removed needs-triage Needs Triage pending-review Pending Review labels Sep 17, 2024
@tenthirtyam tenthirtyam self-assigned this Sep 17, 2024
@tenthirtyam tenthirtyam added this to the v0.11.0 milestone Sep 17, 2024
@tenthirtyam
Copy link
Contributor

Ah, this is an easy fix in the providerConfigure function where if the sddc manager username is not provided it's assume to be cloud builder. will need an else if and then an else with a generic provider credentials error.

tenthirtyam added a commit that referenced this issue Sep 18, 2024
Updates the provider configuration to address the issue where the function assumes the configuration is for Cloud Builder if the SDDC Manager username is not provided.

Added a check to ensure that at least one of the configurations is provided. If neither is provided, we can return an appropriate error message.

Ref #238

Signed-off-by: Ryan Johnson <[email protected]>
@tenthirtyam tenthirtyam linked a pull request Sep 18, 2024 that will close this issue
11 tasks
@tenthirtyam
Copy link
Contributor

Addressed in #239.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants