Skip to content

Commit

Permalink
fix provider
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 committed Sep 21, 2021
1 parent d888d33 commit 1274368
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pingdom/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type Config struct {
APIToken string `mapstructure:"api_token"`
SolarwindsUser string `mapstructure:"solarwinds_user"`
SolarwindsPassword string `mapstructure:"solarwinds_password"`
SolarwindsPassword string `mapstructure:"solarwinds_passwd"`
SolarwindsOrgID string `mapstructure:"solarwinds_org_id"`
}

Expand Down
5 changes: 2 additions & 3 deletions pingdom/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ func Provider() *schema.Provider {
"pingdom_contact": resourcePingdomContact(),
"pingdom_integration": resourcePingdomIntegration(),
"pingdom_maintenance": resourcePingdomMaintenance(),
// "pingdom_user": resourceSolarwindsUser(),
"pingdom_occurrence": resourcePingdomOccurrences(),
"pingdom_tms_check": resourcePingdomTmsCheck(),
"pingdom_occurrence": resourcePingdomOccurrences(),
"pingdom_tms_check": resourcePingdomTmsCheck(),
},
DataSourcesMap: map[string]*schema.Resource{
"pingdom_contact": dataSourcePingdomContact(),
Expand Down
15 changes: 9 additions & 6 deletions pingdom/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ func testAccPreCheck(t *testing.T) {
if v := os.Getenv("PINGDOM_API_TOKEN"); v == "" {
t.Fatal("PINGDOM_API_TOKEN environment variable must be set for acceptance tests")
}
// if v := os.Getenv("SOLARWINDS_USER"); v == "" {
// t.Fatal("SOLARWINDS_USER environment variable must be set for acceptance tests")
// }
// if v := os.Getenv("SOLARWINDS_PASSWD"); v == "" {
// t.Fatal("SOLARWINDS_PASSWD environment variable must be set for acceptance tests")
// }
if v := os.Getenv("SOLARWINDS_USER"); v == "" {
t.Fatal("SOLARWINDS_USER environment variable must be set for acceptance tests")
}
if v := os.Getenv("SOLARWINDS_PASSWD"); v == "" {
t.Fatal("SOLARWINDS_PASSWD environment variable must be set for acceptance tests")
}
if v := os.Getenv("SOLARWINDS_ORG_ID"); v == "" {
t.Fatal("SOLARWINDS_ORG_ID environment variable must be set for acceptance tests")
}
}

func testAccCheckPingdomResourceID(name string) resource.TestCheckFunc {
Expand Down
6 changes: 4 additions & 2 deletions pingdom/resource_pingdom_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/nordcloud/go-pingdom/pingdomext"
)

Expand Down Expand Up @@ -39,8 +40,9 @@ func resourcePingdomIntegration() *schema.Resource {
Required: true,
},
"url": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.IsURLWithHTTPorHTTPS,
},
},
}
Expand Down

0 comments on commit 1274368

Please sign in to comment.