Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/apis/servicecatalog/validation/serviceclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// validateServiceClassName is the validation function for ServiceClass names.
var validateServiceClassName = apivalidation.NameIsDNSSubdomain

const guidFmt string = "[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?"
const guidFmt string = "[a-zA-Z0-9]([-a-zA-Z0-9.]*[a-zA-Z0-9])?"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's drop all checks except for non-empty string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with changing that. @pmorie are you ok with this too?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer not to drop them all, or we will never get a clear picture of what kind of stuff people return in this field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we care since we don't do anything with this data except echo it back to the broker?

const guidMaxLength int = 63

// guidRegexp is a loosened validation for
Expand Down
9 changes: 9 additions & 0 deletions pkg/apis/servicecatalog/validation/serviceclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ func TestValidateServiceClass(t *testing.T) {
}(),
valid: true,
},
{
name: "valid serviceClass - period in GUID",
serviceClass: func() *servicecatalog.ServiceClass {
s := validServiceClass()
s.ExternalID = "4315f5e1-0139-4ecf-9706-9df0aff33e5a.plan-name"
return s
}(),
valid: true,
},
{
name: "invalid serviceClass - has namespace",
serviceClass: func() *servicecatalog.ServiceClass {
Expand Down