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

Private datacenter capabilities #170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Alexander-Kita
Copy link
Collaborator

@Alexander-Kita Alexander-Kita commented Oct 9, 2024

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

pi_datacenters (d)

=== RUN   TestAccIBMPIDatacenterDataSourcePrivate
--- PASS: TestAccIBMPIDatacenterDataSourcePrivate (22.04s)
PASS
=== RUN   TestAccIBMPIDatacenterDataSourceBasic
--- PASS: TestAccIBMPIDatacenterDataSourceBasic (10.14s)
PASS

pi_datacenters (d)

=== RUN   TestAccIBMPIDatacentersDataSourceBasic
--- PASS: TestAccIBMPIDatacentersDataSourceBasic (13.22s)
PASS
=== RUN   TestAccIBMPIDatacentersDataSourcePrivate
--- PASS: TestAccIBMPIDatacentersDataSourcePrivate (20.12s)
PASS

@Alexander-Kita Alexander-Kita marked this pull request as ready for review October 14, 2024 14:30
Comment on lines +188 to +199

var client *instance.IBMPIDatacentersClient
if !sess.IsOnPrem() {
client = instance.NewIBMPIDatacenterClient(ctx, sess, "")
} else {
if cloudInstanceId, ok := d.GetOk(Arg_CloudInstanceID); ok {
client = instance.NewIBMPIDatacenterClient(ctx, sess, cloudInstanceId.(string))
} else {
return diag.Errorf("must provide %s if the datacenter is private/on-prem", Arg_CloudInstanceID)
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you update it so the on premise check is done in the sdk and only have

var cloudInstance := ""
if cloudInstanceId, ok := d.GetOk(Arg_CloudInstanceID); ok {
			cloudInstance = cloudInstance
		} 
client = instance.NewIBMPIDatacenterClient(ctx, sess, cloudInstance)

And update the doc to say the instanceID is required if onprem

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