Skip to content

Commit

Permalink
Merge pull request #4 from Edge-Center/CLOUD-174-security_group
Browse files Browse the repository at this point in the history
Fixed security group attachment
  • Loading branch information
anaxaim authored Feb 14, 2023
2 parents ae03cfc + 37c8fa6 commit 68780c3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions edgecenter/resource_edgecenter_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,11 +848,17 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, m inter
}
portID, err := instances.ExtractInstancePortIDFromTask(taskInfo)
if err != nil {
return nil, fmt.Errorf("cannot retrieve instance port ID from task info: %w", err)
var taskData *map[string]interface{} = taskInfo.Data
reserved_fixed_ip_id, ok := (*taskData)["reserved_fixed_ip_id"]
if !ok || reserved_fixed_ip_id.(string) == "" {
return nil, fmt.Errorf("cannot retrieve instance port ID from task info: %w", err)
} else {
portID = reserved_fixed_ip_id.(string)
}

}
return portID, nil
},
)
})

if err != nil {
return diag.FromErr(err)
Expand Down

0 comments on commit 68780c3

Please sign in to comment.