Fix suggestions from @ndmckinley.

This commit is contained in:
Paddy Carver 2018-05-18 17:01:40 -07:00
parent e74ab9d507
commit 98b6323342
2 changed files with 8 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import (
)
var (
appEngineOperationIdRE = regexp.MustCompile(fmt.Sprintf("apps/%s/operations/(.*)", ProjectRegex))
appEngineOperationIdRegexp = regexp.MustCompile(fmt.Sprintf("apps/%s/operations/(.*)", ProjectRegex))
)
type AppEngineOperationWaiter struct {
@ -24,7 +24,7 @@ type AppEngineOperationWaiter struct {
func (w *AppEngineOperationWaiter) RefreshFunc() resource.StateRefreshFunc {
return func() (interface{}, string, error) {
matches := appEngineOperationIdRE.FindStringSubmatch(w.Op.Name)
matches := appEngineOperationIdRegexp.FindStringSubmatch(w.Op.Name)
if len(matches) != 2 {
return nil, "", fmt.Errorf("Expected %d results of parsing operation name, got %d from %s", 2, len(matches), w.Op.Name)
}

View File

@ -114,6 +114,8 @@ func appEngineResource() *schema.Resource {
"auth_domain": &schema.Schema{
Type: schema.TypeString,
Optional: true,
// We're having trouble with PATCH throwing 400s/500s, so we need this
// to force a new resource until we can get updating working.
ForceNew: true,
Computed: true,
},
@ -143,6 +145,8 @@ func appEngineResource() *schema.Resource {
"serving_status": &schema.Schema{
Type: schema.TypeString,
Optional: true,
// We're having trouble with PATCH throwing 400s/500s, so we need this
// to force a new resource until we can get updating working.
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
"UNSPECIFIED",
@ -168,6 +172,8 @@ func appEngineResource() *schema.Resource {
Type: schema.TypeList,
Optional: true,
Computed: true,
// We're having trouble with PATCH throwing 400s/500s, so we need this
// to force a new resource until we can get updating working.
ForceNew: true,
MaxItems: 1,
Elem: appEngineFeatureSettingsResource(),
@ -261,7 +267,6 @@ func resourceGoogleProjectCreate(d *schema.ResourceData, meta interface{}) error
if err != nil {
return err
}
log.Printf("[DEBUG] Creating App Engine if %v is true", app != nil)
if app != nil {
log.Printf("[DEBUG] Enabling App Engine")
// enable the app engine APIs so we can create stuff