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

While creating a DL Connect gateway do not wait for gateway to be provisioned for few providers #2458

Merged
merged 2 commits into from
Apr 2, 2021
Merged

Conversation

ajay-malhotra1
Copy link
Contributor

When a DL Connect gateway is created we wait for the gateway to be moved to provisioned state. But for few providers we shall not wait for the gateway to be provisioned.

So we will check the provider to which the port, that is being used to create a connect gateway, belongs and if it matches those providers we will not wait for the gateway to be provisioned.

@@ -541,10 +542,20 @@ func resourceIBMdlGatewayCreate(d *schema.ResourceData, meta interface{}) error

log.Printf("[INFO] Created Direct Link Gateway (%s Template) : %s", dtype, *gateway.ID)
if dtype == "connect" {
_, err = isWaitForDirectLinkAvailable(directLink, d.Id(), d.Timeout(schema.TimeoutCreate))
getPortOptions := directLink.NewGetPortOptions(*gateway.Port.ID)
port, response, err := directLink.GetPort(getPortOptions)
if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if err != nil || response != nil || port != nil

so that we are safe to handle the condition if port is nil by any chance

@hkantare hkantare merged commit 3cbae70 into IBM-Cloud:master Apr 2, 2021
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