Skip to content

Commit

Permalink
Merge pull request #52 from mercari/fix-deprecated-gate-endpoint
Browse files Browse the repository at this point in the history
Fix deprecated gate endpoint getter
  • Loading branch information
KeisukeYamashita authored Jul 31, 2020
2 parents d4c224f + 80c53dd commit 03d8fd9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spinnaker/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ func Provider() *schema.Provider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"server": {
Type: schema.TypeString,
Description: "URL for Spinnaker Gate",
Deprecated: "use `gate_endpoint` instead",
Optional: true,
Type: schema.TypeString,
Description: "URL for Spinnaker Gate",
Deprecated: "use `gate_endpoint` instead",
Optional: true,
ConflictsWith: []string{"gate_endpoint"},
},
"gate_endpoint": {
Type: schema.TypeString,
Optional: true,
Optional: true,
Description: "URL for Spinnaker Gate",
DefaultFunc: schema.EnvDefaultFunc("GATE_ENDPOINT", nil),
},
Expand Down Expand Up @@ -62,8 +62,8 @@ type gateConfig struct {

func providerConfigureFunc(data *schema.ResourceData) (interface{}, error) {
var gateEndpoint string
if v, deprecated := data.Get("server").(string); deprecated {
gateEndpoint = v
if v, deprecated := data.GetOk("server"); deprecated {
gateEndpoint = v.(string)
} else {
gateEndpoint = data.Get("gate_endpoint").(string)
}
Expand Down

0 comments on commit 03d8fd9

Please sign in to comment.