Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Aris van Ommeren committed May 1, 2020
1 parent 4744654 commit c3b5c28
Show file tree
Hide file tree
Showing 6 changed files with 488 additions and 341 deletions.
@@ -1,4 +1,4 @@
package web
package parse

import (
"fmt"
Expand All @@ -12,7 +12,7 @@ type FunctionAppSlotResourceID struct {
Name string
}

func ParseFunctionAppSlotID(input string) (*FunctionAppSlotResourceID, error) {
func FunctionAppSlotID(input string) (*FunctionAppSlotResourceID, error) {
id, err := azure.ParseAzureResourceID(input)
if err != nil {
return nil, fmt.Errorf("[ERROR] Unable to parse App Service Slot ID %q: %+v", input, err)
Expand Down
14 changes: 2 additions & 12 deletions azurerm/internal/services/web/resource_arm_app_service.go
Expand Up @@ -3,7 +3,6 @@ package web
import (
"fmt"
"log"
"regexp"
"time"

"github.com/Azure/azure-sdk-for-go/services/web/mgmt/2019-08-01/web"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags"
azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
Expand Down Expand Up @@ -44,7 +44,7 @@ func resourceArmAppService() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validateAppServiceName,
ValidateFunc: validate.AppServiceName,
},

"identity": azure.SchemaAppServiceIdentity(),
Expand Down Expand Up @@ -760,16 +760,6 @@ func flattenAppServiceAppSettings(input map[string]*string) map[string]string {
return output
}

func validateAppServiceName(v interface{}, k string) (warnings []string, errors []error) {
value := v.(string)

if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched {
errors = append(errors, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k))
}

return warnings, errors
}

func flattenAppServiceSiteCredential(input *web.UserProperties) []interface{} {
results := make([]interface{}, 0)
result := make(map[string]interface{})
Expand Down

0 comments on commit c3b5c28

Please sign in to comment.