Skip to content

Commit

Permalink
fixes #20351 - Update length to 64 for databricks_access_controller_n…
Browse files Browse the repository at this point in the history
…ame (#20353)

* issue/20351 - Update name length to 64

* Update test
  • Loading branch information
Threpio committed Feb 8, 2023
1 parent 89f7bc3 commit e1a50bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ func AccessConnectorName(i interface{}, k string) (warnings []string, errors []e
errors = append(errors, fmt.Errorf("%q must be at least 1 character: %q", k, v))
}

// 3) The value must have a length of at most 30
if len(v) > 30 {
errors = append(errors, fmt.Errorf("%q must be no more than 30 characters: %q", k, v))
// 3) The value must have a length of at most 64
if len(v) > 64 {
errors = append(errors, fmt.Errorf("%q must be no more than 64 characters: %q", k, v))
}

// 4) Only alphanumeric characters, underscores, and hyphens are allowed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func TestAccessConnectorName(t *testing.T) {
const errEmpty = "cannot be an empty string"
const errMaxLen = "must be no more than 30 characters"
const errMaxLen = "must be no more than 64 characters"
const errAllowList = "can contain only alphanumeric characters, underscores, and hyphens"

cases := []struct {
Expand All @@ -26,7 +26,7 @@ func TestAccessConnectorName(t *testing.T) {
},
{
Name: "Maximum character length",
Input: "012345678901234567890123456789", // 30 chars
Input: "0123456789012345678901234567890123456789012345678901234567890123", // 64 chars
},

// Simple negative cases:
Expand All @@ -37,7 +37,7 @@ func TestAccessConnectorName(t *testing.T) {
},
{
Name: "Above maximum character length",
Input: "01234567890123456789012345678901", // 31 chars
Input: "01234567890123456789012345678901234567890123456789012345678901234", // 65 chars
ExpectedErrors: []string{errMaxLen},
},
{
Expand Down

0 comments on commit e1a50bc

Please sign in to comment.