providers/heroku: upgrade vendored cyberdelia/heroku-go client (#14672)

* Update vendored github.com/cyberdelia/heroku-go/v3

* Update heroku provider code to work with the newly generated heroku-go API
This commit is contained in:
cmorent 2017-05-24 13:04:17 +02:00 committed by Paul Stack
parent 8edaa883fb
commit c08253e8d5
16 changed files with 3445 additions and 3436 deletions

View File

@ -10,7 +10,7 @@ import (
)
func TestAccHerokuPipelineCoupling_importBasic(t *testing.T) {
var coupling heroku.PipelineCouplingInfoResult
var coupling heroku.PipelineCoupling
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
pipelineName := fmt.Sprintf("tftest-%s", acctest.RandString(10))

View File

@ -111,7 +111,7 @@ func resourceHerokuAddonCreate(d *schema.ResourceData, meta interface{}) error {
func resourceHerokuAddonRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*heroku.Service)
addon, err := resourceHerokuAddonRetrieve(
addon, err := resourceHerokuAddonRetrieveByApp(
d.Get("app").(string), d.Id(), client)
if err != nil {
return err
@ -174,8 +174,18 @@ func resourceHerokuAddonDelete(d *schema.ResourceData, meta interface{}) error {
return nil
}
func resourceHerokuAddonRetrieve(app string, id string, client *heroku.Service) (*heroku.AddOnInfoResult, error) {
addon, err := client.AddOnInfo(context.TODO(), app, id)
func resourceHerokuAddonRetrieve(id string, client *heroku.Service) (*heroku.AddOn, error) {
addon, err := client.AddOnInfo(context.TODO(), id)
if err != nil {
return nil, fmt.Errorf("Error retrieving addon: %s", err)
}
return addon, nil
}
func resourceHerokuAddonRetrieveByApp(app string, id string, client *heroku.Service) (*heroku.AddOn, error) {
addon, err := client.AddOnInfoByApp(context.TODO(), app, id)
if err != nil {
return nil, fmt.Errorf("Error retrieving addon: %s", err)
@ -188,7 +198,8 @@ func resourceHerokuAddonRetrieve(app string, id string, client *heroku.Service)
// watch an AddOn.
func AddOnStateRefreshFunc(client *heroku.Service, appID, addOnID string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
addon, err := client.AddOnInfo(context.TODO(), appID, addOnID)
addon, err := resourceHerokuAddonRetrieveByApp(appID, addOnID, client)
if err != nil {
return nil, "", err
}

View File

@ -12,7 +12,7 @@ import (
)
func TestAccHerokuAddon_Basic(t *testing.T) {
var addon heroku.AddOnInfoResult
var addon heroku.AddOn
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -39,7 +39,7 @@ func TestAccHerokuAddon_Basic(t *testing.T) {
// GH-198
func TestAccHerokuAddon_noPlan(t *testing.T) {
var addon heroku.AddOnInfoResult
var addon heroku.AddOn
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -81,7 +81,7 @@ func testAccCheckHerokuAddonDestroy(s *terraform.State) error {
continue
}
_, err := client.AddOnInfo(context.TODO(), rs.Primary.Attributes["app"], rs.Primary.ID)
_, err := client.AddOnInfoByApp(context.TODO(), rs.Primary.Attributes["app"], rs.Primary.ID)
if err == nil {
return fmt.Errorf("Addon still exists")
@ -91,7 +91,7 @@ func testAccCheckHerokuAddonDestroy(s *terraform.State) error {
return nil
}
func testAccCheckHerokuAddonAttributes(addon *heroku.AddOnInfoResult, n string) resource.TestCheckFunc {
func testAccCheckHerokuAddonAttributes(addon *heroku.AddOn, n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
if addon.Plan.Name != n {
@ -102,7 +102,7 @@ func testAccCheckHerokuAddonAttributes(addon *heroku.AddOnInfoResult, n string)
}
}
func testAccCheckHerokuAddonExists(n string, addon *heroku.AddOnInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuAddonExists(n string, addon *heroku.AddOn) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
@ -116,7 +116,7 @@ func testAccCheckHerokuAddonExists(n string, addon *heroku.AddOnInfoResult) reso
client := testAccProvider.Meta().(*heroku.Service)
foundAddon, err := client.AddOnInfo(context.TODO(), rs.Primary.Attributes["app"], rs.Primary.ID)
foundAddon, err := client.AddOnInfoByApp(context.TODO(), rs.Primary.Attributes["app"], rs.Primary.ID)
if err != nil {
return err

View File

@ -12,7 +12,7 @@ import (
)
func TestAccHerokuAppFeature(t *testing.T) {
var feature heroku.AppFeatureInfoResult
var feature heroku.AppFeature
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -62,7 +62,7 @@ func testAccCheckHerokuFeatureDestroy(s *terraform.State) error {
return nil
}
func testAccCheckHerokuFeatureExists(n string, feature *heroku.AppFeatureInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuFeatureExists(n string, feature *heroku.AppFeature) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
@ -95,7 +95,7 @@ func testAccCheckHerokuFeatureExists(n string, feature *heroku.AppFeatureInfoRes
}
}
func testAccCheckHerokuFeatureEnabled(feature *heroku.AppFeatureInfoResult, enabled bool) resource.TestCheckFunc {
func testAccCheckHerokuFeatureEnabled(feature *heroku.AppFeature, enabled bool) resource.TestCheckFunc {
return func(s *terraform.State) error {
if feature.Enabled != enabled {
return fmt.Errorf("Bad enabled: %v", feature.Enabled)

View File

@ -13,7 +13,7 @@ import (
)
func TestAccHerokuApp_Basic(t *testing.T) {
var app heroku.AppInfoResult
var app heroku.App
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -37,7 +37,7 @@ func TestAccHerokuApp_Basic(t *testing.T) {
}
func TestAccHerokuApp_NameChange(t *testing.T) {
var app heroku.AppInfoResult
var app heroku.App
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
appName2 := fmt.Sprintf("%s-v2", appName)
@ -75,7 +75,7 @@ func TestAccHerokuApp_NameChange(t *testing.T) {
}
func TestAccHerokuApp_NukeVars(t *testing.T) {
var app heroku.AppInfoResult
var app heroku.App
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -110,7 +110,7 @@ func TestAccHerokuApp_NukeVars(t *testing.T) {
}
func TestAccHerokuApp_Buildpacks(t *testing.T) {
var app heroku.AppInfoResult
var app heroku.App
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -149,7 +149,7 @@ func TestAccHerokuApp_Buildpacks(t *testing.T) {
}
func TestAccHerokuApp_ExternallySetBuildpacks(t *testing.T) {
var app heroku.AppInfoResult
var app heroku.App
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -252,7 +252,7 @@ func testAccCheckHerokuAppDestroy(s *terraform.State) error {
return nil
}
func testAccCheckHerokuAppAttributes(app *heroku.AppInfoResult, appName string) resource.TestCheckFunc {
func testAccCheckHerokuAppAttributes(app *heroku.App, appName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
client := testAccProvider.Meta().(*heroku.Service)
@ -281,7 +281,7 @@ func testAccCheckHerokuAppAttributes(app *heroku.AppInfoResult, appName string)
}
}
func testAccCheckHerokuAppAttributesUpdated(app *heroku.AppInfoResult, appName string) resource.TestCheckFunc {
func testAccCheckHerokuAppAttributesUpdated(app *heroku.App, appName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
client := testAccProvider.Meta().(*heroku.Service)
@ -308,7 +308,7 @@ func testAccCheckHerokuAppAttributesUpdated(app *heroku.AppInfoResult, appName s
}
}
func testAccCheckHerokuAppAttributesNoVars(app *heroku.AppInfoResult, appName string) resource.TestCheckFunc {
func testAccCheckHerokuAppAttributesNoVars(app *heroku.App, appName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
client := testAccProvider.Meta().(*heroku.Service)
@ -424,7 +424,7 @@ func testAccCheckHerokuAppAttributesOrg(app *heroku.OrganizationApp, appName, sp
}
}
func testAccCheckHerokuAppExists(n string, app *heroku.AppInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuAppExists(n string, app *heroku.App) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]

View File

@ -122,7 +122,7 @@ func resourceHerokuCertDelete(d *schema.ResourceData, meta interface{}) error {
return nil
}
func resourceHerokuSSLCertRetrieve(app string, id string, client *heroku.Service) (*heroku.SSLEndpointInfoResult, error) {
func resourceHerokuSSLCertRetrieve(app string, id string, client *heroku.Service) (*heroku.SSLEndpoint, error) {
addon, err := client.SSLEndpointInfo(context.TODO(), app, id)
if err != nil {

View File

@ -29,7 +29,7 @@ import (
// on update seems to allow the test to run smoothly; in real life, this test
// case is definitely an extreme edge case.
func TestAccHerokuCert_EU(t *testing.T) {
var endpoint heroku.SSLEndpointInfoResult
var endpoint heroku.SSLEndpoint
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
wd, _ := os.Getwd()
@ -74,7 +74,7 @@ func TestAccHerokuCert_EU(t *testing.T) {
}
func TestAccHerokuCert_US(t *testing.T) {
var endpoint heroku.SSLEndpointInfoResult
var endpoint heroku.SSLEndpoint
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
wd, _ := os.Getwd()
@ -182,7 +182,7 @@ func testAccCheckHerokuCertDestroy(s *terraform.State) error {
return nil
}
func testAccCheckHerokuCertificateChain(endpoint *heroku.SSLEndpointInfoResult, chain string) resource.TestCheckFunc {
func testAccCheckHerokuCertificateChain(endpoint *heroku.SSLEndpoint, chain string) resource.TestCheckFunc {
return func(s *terraform.State) error {
if endpoint.CertificateChain != chain {
@ -193,7 +193,7 @@ func testAccCheckHerokuCertificateChain(endpoint *heroku.SSLEndpointInfoResult,
}
}
func testAccCheckHerokuCertExists(n string, endpoint *heroku.SSLEndpointInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuCertExists(n string, endpoint *heroku.SSLEndpoint) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]

View File

@ -12,7 +12,7 @@ import (
)
func TestAccHerokuDomain_Basic(t *testing.T) {
var domain heroku.DomainInfoResult
var domain heroku.Domain
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -55,7 +55,7 @@ func testAccCheckHerokuDomainDestroy(s *terraform.State) error {
return nil
}
func testAccCheckHerokuDomainAttributes(Domain *heroku.DomainInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuDomainAttributes(Domain *heroku.Domain) resource.TestCheckFunc {
return func(s *terraform.State) error {
if Domain.Hostname != "terraform.example.com" {
@ -66,7 +66,7 @@ func testAccCheckHerokuDomainAttributes(Domain *heroku.DomainInfoResult) resourc
}
}
func testAccCheckHerokuDomainExists(n string, Domain *heroku.DomainInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuDomainExists(n string, Domain *heroku.Domain) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]

View File

@ -49,7 +49,7 @@ func resourceHerokuDrainCreate(d *schema.ResourceData, meta interface{}) error {
log.Printf("[DEBUG] Drain create configuration: %#v, %#v", app, url)
var dr *heroku.LogDrainCreateResult
var dr *heroku.LogDrain
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
d, err := client.LogDrainCreate(context.TODO(), app, heroku.LogDrainCreateOpts{URL: url})
if err != nil {

View File

@ -12,7 +12,7 @@ import (
)
func TestAccHerokuDrain_Basic(t *testing.T) {
var drain heroku.LogDrainInfoResult
var drain heroku.LogDrain
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
resource.Test(t, resource.TestCase{
@ -53,7 +53,7 @@ func testAccCheckHerokuDrainDestroy(s *terraform.State) error {
return nil
}
func testAccCheckHerokuDrainAttributes(Drain *heroku.LogDrainInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuDrainAttributes(Drain *heroku.LogDrain) resource.TestCheckFunc {
return func(s *terraform.State) error {
if Drain.URL != "syslog://terraform.example.com:1234" {
@ -68,7 +68,7 @@ func testAccCheckHerokuDrainAttributes(Drain *heroku.LogDrainInfoResult) resourc
}
}
func testAccCheckHerokuDrainExists(n string, Drain *heroku.LogDrainInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuDrainExists(n string, Drain *heroku.LogDrain) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]

View File

@ -12,7 +12,7 @@ import (
)
func TestAccHerokuPipelineCoupling_Basic(t *testing.T) {
var coupling heroku.PipelineCouplingInfoResult
var coupling heroku.PipelineCoupling
appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
pipelineName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
@ -57,7 +57,7 @@ resource "heroku_pipeline_coupling" "default" {
`, appName, pipelineName, stageName)
}
func testAccCheckHerokuPipelineCouplingExists(n string, pipeline *heroku.PipelineCouplingInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuPipelineCouplingExists(n string, pipeline *heroku.PipelineCoupling) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
@ -86,7 +86,7 @@ func testAccCheckHerokuPipelineCouplingExists(n string, pipeline *heroku.Pipelin
}
}
func testAccCheckHerokuPipelineCouplingAttributes(coupling *heroku.PipelineCouplingInfoResult, pipelineResource, stageName string) resource.TestCheckFunc {
func testAccCheckHerokuPipelineCouplingAttributes(coupling *heroku.PipelineCoupling, pipelineResource, stageName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
pipeline, ok := s.RootModule().Resources[pipelineResource]
if !ok {

View File

@ -12,7 +12,7 @@ import (
)
func TestAccHerokuPipeline_Basic(t *testing.T) {
var pipeline heroku.PipelineInfoResult
var pipeline heroku.Pipeline
pipelineName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
pipelineName2 := fmt.Sprintf("%s-2", pipelineName)
@ -48,7 +48,7 @@ resource "heroku_pipeline" "foobar" {
`, pipelineName)
}
func testAccCheckHerokuPipelineExists(n string, pipeline *heroku.PipelineInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuPipelineExists(n string, pipeline *heroku.Pipeline) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]

View File

@ -13,7 +13,7 @@ import (
)
func TestAccHerokuSpace_Basic(t *testing.T) {
var space heroku.SpaceInfoResult
var space heroku.Space
spaceName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
spaceName2 := fmt.Sprintf("tftest-%s", acctest.RandString(10))
org := os.Getenv("HEROKU_ORGANIZATION")
@ -56,7 +56,7 @@ resource "heroku_space" "foobar" {
`, spaceName, orgName)
}
func testAccCheckHerokuSpaceExists(n string, space *heroku.SpaceInfoResult) resource.TestCheckFunc {
func testAccCheckHerokuSpaceExists(n string, space *heroku.Space) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
@ -85,7 +85,7 @@ func testAccCheckHerokuSpaceExists(n string, space *heroku.SpaceInfoResult) reso
}
}
func testAccCheckHerokuSpaceAttributes(space *heroku.SpaceInfoResult, spaceName string) resource.TestCheckFunc {
func testAccCheckHerokuSpaceAttributes(space *heroku.Space, spaceName string) resource.TestCheckFunc {
return func(s *terraform.State) error {
if space.Name != spaceName {
return fmt.Errorf("Bad name: %s", space.Name)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

6
vendor/vendor.json vendored
View File

@ -1319,10 +1319,10 @@
"revisionTime": "2016-07-14T17:28:59Z"
},
{
"checksumSHA1": "cSJrzeVJLa9x2xoVqrJLz2Y+l0Y=",
"checksumSHA1": "ySg+wxsWmk5AipJDFGGG2JhxIPU=",
"path": "github.com/cyberdelia/heroku-go/v3",
"revision": "58deda4c1fb0b4803387b29dc916c21887b81954",
"revisionTime": "2017-03-06T18:52:00Z"
"revision": "84e6d0171b96992458bcbc5609d28b35edf26f00",
"revisionTime": "2017-05-16T20:23:11Z"
},
{
"checksumSHA1": "/5cvgU+J4l7EhMXTK76KaCAfOuU=",