Skip to content

Commit

Permalink
Merge pull request #6919 from jtopjian/openstack-lb-pool-provider
Browse files Browse the repository at this point in the history
provider/openstack: Add lb_provider argument to lb_pool_v1 resource
  • Loading branch information
jtopjian committed Jun 3, 2016
2 parents 58899cc + fd91df2 commit c1ec286
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 84 deletions.
156 changes: 78 additions & 78 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions builtin/providers/openstack/resource_openstack_lb_pool_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ func resourceLBPoolV1() *schema.Resource {
Required: true,
ForceNew: false,
},
"lb_provider": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"tenant_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -116,6 +122,7 @@ func resourceLBPoolV1Create(d *schema.ResourceData, meta interface{}) error {
SubnetID: d.Get("subnet_id").(string),
LBMethod: d.Get("lb_method").(string),
TenantID: d.Get("tenant_id").(string),
Provider: d.Get("lb_provider").(string),
}

log.Printf("[DEBUG] Create Options: %#v", createOpts)
Expand Down Expand Up @@ -182,6 +189,7 @@ func resourceLBPoolV1Read(d *schema.ResourceData, meta interface{}) error {
d.Set("protocol", p.Protocol)
d.Set("subnet_id", p.SubnetID)
d.Set("lb_method", p.LBMethod)
d.Set("lb_provider", p.Provider)
d.Set("tenant_id", p.TenantID)
d.Set("monitor_ids", p.MonitorIDs)
d.Set("member_ids", p.MemberIDs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestAccLBV1Pool_basic(t *testing.T) {
Config: testAccLBV1Pool_basic,
Check: resource.ComposeTestCheckFunc(
testAccCheckLBV1PoolExists(t, "openstack_lb_pool_v1.pool_1", &pool),
resource.TestCheckResourceAttr("openstack_lb_pool_v1.pool_1", "lb_provider", "haproxy"),
),
},
resource.TestStep{
Expand Down Expand Up @@ -144,6 +145,7 @@ var testAccLBV1Pool_basic = fmt.Sprintf(`
protocol = "HTTP"
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
lb_method = "ROUND_ROBIN"
lb_provider = "haproxy"
}`,
OS_REGION_NAME, OS_REGION_NAME, OS_REGION_NAME)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c1ec286

Please sign in to comment.