Skip to content

Commit

Permalink
bump vendored sdk, remove extra fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ack committed Mar 21, 2016
1 parent c4b2322 commit 4c4be81
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 158 deletions.
40 changes: 18 additions & 22 deletions Godeps/Godeps.json

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

19 changes: 0 additions & 19 deletions builtin/providers/clc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package clc
import (
"fmt"
"log"
"net/url"
"strconv"

clc "github.com/CenturyLinkCloud/clc-sdk"
Expand Down Expand Up @@ -31,18 +30,6 @@ func Provider() terraform.ResourceProvider {
DefaultFunc: schema.EnvDefaultFunc("CLC_PASSWORD", nil),
Description: "Your CLC password",
},
"account": &schema.Schema{

This comment has been minimized.

Copy link
@fatmcgav

fatmcgav Mar 22, 2016

@ack What was the logic behind removing this?

Reason I ask is that our model involves multiple sub-accounts to separate different env's (dev, test, prod etc) and without a way to programmatically provide the 'account', things get complicated...

Cheers
Gav

This comment has been minimized.

Copy link
@ack

ack Mar 22, 2016

Author Owner

for most users requiring the account field is unnecessary, at least as a required field. would setting env var CLC_ALIAS={dev,test,prod} work for you? could add it back in as an optional field..

This comment has been minimized.

Copy link
@fatmcgav

fatmcgav Mar 22, 2016

Agree that as a required field, it's over-kill... However would prefer to retain it as an optional field...
This then allows me to provide the account alias based on a lookup... See: https://gist.github.com/fatmcgav/db5b8115d23a6162f6e9

Setting as an env var is an option, but it's not as elegant and requires more knowledge about the account ID's than a simple 'prod|dev|stg'...

This comment has been minimized.

Copy link
@ack

ack Mar 22, 2016

Author Owner

k, re-added account back into the config as an optional:
hashicorp#5785

also, we're officially in mainline now so feel to post there:
https://github.com/hashicorp/terraform/tree/master/builtin/providers/clc

Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("CLC_ACCOUNT", nil),
Description: "Your CLC account alias",
},
"url": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Base CLC API url",
DefaultFunc: schema.EnvDefaultFunc("CLC_BASE_URL", nil),
},
},

ResourcesMap: map[string]*schema.Resource{
Expand All @@ -65,12 +52,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
if err != nil {
return nil, fmt.Errorf("Failed to create CLC config with provided details: %v", err)
}
if urlStr := d.Get("url").(string); urlStr != "" {
uri, err := url.Parse(urlStr)
if err == nil {
config.BaseURL = uri
}
}
config.UserAgent = fmt.Sprintf("terraform-clc terraform/%s", terraform.Version)

client := clc.New(config)
Expand Down
12 changes: 8 additions & 4 deletions vendor/github.com/CenturyLinkCloud/clc-sdk/api/api.go

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

22 changes: 0 additions & 22 deletions vendor/github.com/mikebeyer/env/LICENSE.md

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/github.com/mikebeyer/env/README.md

This file was deleted.

73 changes: 0 additions & 73 deletions vendor/github.com/mikebeyer/env/env.go

This file was deleted.

0 comments on commit 4c4be81

Please sign in to comment.