openservicebrokerapi / servicebroker

Open Service Broker API Specification
https://openservicebrokerapi.org/
Apache License 2.0
1.19k stars 434 forks source link

Provide some guidance for CLI-friendly names #425

Closed duglin closed 6 years ago

duglin commented 6 years ago

Closes #305

Signed-off-by: Doug Davis dug@us.ibm.com

cfdreddbot commented 6 years ago

Hey duglin!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

angarg12 commented 6 years ago

LGTM

Approved with PullApprove

mattmcneeney commented 6 years ago

LGTM

Approved with PullApprove

duglin commented 6 years ago

@angarg12 @mattmcneeney re-review needed

mattmcneeney commented 6 years ago

LGTM

Approved with PullApprove

angarg12 commented 6 years ago

LGTM

Approved with PullApprove

avade commented 6 years ago

LGTM

Approved with PullApprove

duglin commented 6 years ago

just one more needed - @vaikas-google ? @pmorie ?

duglin commented 6 years ago

@fmui ?

fmui commented 6 years ago

LGTM

Approved with PullApprove

vaikas commented 6 years ago

LGTM

Approved with PullApprove

avade commented 6 years ago

LGTM

dotchev commented 6 years ago

For backwards compatibility reasons, this specification does not preclude the use of CLI-unfriendly strings that might cause problems for command line parsers (or that are not very meaningful to users), such as -. It is therefore RECOMMENDED that implementations avoid such strings.

This seems contradicting with

A CLI-friendly name of the service. MUST only contain alphanumeric characters, periods, and hyphens (no spaces).

The issue we have is that we have many services in CF that use some other characters like _. Now we cannot register these in Service Catalog in K8S.

Status:   ErrorSyncingCatalog - Error syncing catalog from ClusterServiceBroker.Error reconciling ClusterServiceClass (K8S: "367188a4-2511-4038-9be7-9694b05214dc" ExternalName: "simple_service") (broker "simple-broker"): ClusterServiceClass.servicecatalog.k8s.io "367188a4-2511-4038-9be7-9694b05214dc" is invalid: spec.externalName: Invalid value: "simple_service": [-.a-zA-Z0-9]+ (regex used for validation is 'service-name-40d-0983-1b89') @ 2018-09-14 10:16:34 +0000 UTC  
duglin commented 6 years ago

I was going to open up an issue for this exact situation (the underscore) because we're seeing it too. Apparently CF only verifies that its a string so I'm not sure why the spec places any restrictions at all.

As for those 2 spots in the spec... they're not exactly contradictory. The 2nd one tries to constrain the set of valid characters, the 1st one tries to tell people to be smart about what words they use while using those characters. I think the example given is a good one.... while "-" is a valid character, its really odd (and not friendly) to use just "-" as the service name.

Issue: https://github.com/openservicebrokerapi/servicebroker/issues/603