Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Remove regex validation of service class external IDs #2303

Merged

Conversation

jberkhahn
Copy link
Contributor

Per the OSB API spec, although external ID is recommended to be a GUID, it can be any non-empty string. So, remove the regex validation, and add a validation to assert it's non-empty.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 27, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 27, 2018
@jberkhahn jberkhahn requested review from duglin and removed request for carolynvs and nilebox August 27, 2018 22:49
Copy link
Contributor

@MHBauer MHBauer left a comment

Choose a reason for hiding this comment

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

impl looks good.

@@ -248,10 +257,10 @@ func TestValidateServiceClass(t *testing.T) {
valid: false,
},
{
name: "invalid serviceClass - invalid guid",
name: "invalid serviceClass - invalid externalID",
Copy link
Contributor

Choose a reason for hiding this comment

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

dup of test immediately above.

serviceClass: func() *servicecatalog.ClusterServiceClass {
s := validClusterServiceClass()
s.Spec.ExternalID = "1234-4354a\\%-49b"
s.Spec.ExternalID = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

dup of test immediately above.

@@ -62,14 +62,23 @@ func TestValidateClusterServiceClass(t *testing.T) {
valid: true,
},
{
name: "valid serviceClass - period in GUID",
name: "valid serviceClass - period in externalID:2",
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the :2 for?

serviceClass: func() *servicecatalog.ClusterServiceClass {
s := validClusterServiceClass()
s.Spec.ExternalID = "4315f5e1-0139-4ecf-9706-9df0aff33e5a.plan-name"
return s
}(),
valid: true,
},
{
name: "valid serviceClass - underscore in ExternalID",
serviceClass: func() *servicecatalog.ClusterServiceClass {
Copy link
Contributor

Choose a reason for hiding this comment

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

also need this test below for ServiceClass, (in theory)

@jberkhahn jberkhahn dismissed MHBauer’s stale review August 28, 2018 18:18

Implemented suggested changes

@jberkhahn
Copy link
Contributor Author

/retest

Copy link
Contributor

@MHBauer MHBauer left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 28, 2018
@MHBauer
Copy link
Contributor

MHBauer commented Aug 28, 2018

/assign @duglin

@duglin
Copy link
Contributor

duglin commented Aug 28, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: duglin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 28, 2018
@k8s-ci-robot k8s-ci-robot merged commit 6f42b70 into kubernetes-retired:master Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants