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 23 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c0de801
Pause, going to try to use the label selector again.
Feb 28, 2018
4060ca1
A working example using label selectors backing code for class.
Feb 28, 2018
3eac4e2
Working simple example of classes and plans filtering.
Feb 28, 2018
c1fd237
Cleaning up the types.
Feb 28, 2018
9dd7bc2
Add comments for current changes.
Feb 28, 2018
7ecd694
Adding feature flag for Catalog Restrictions.
Feb 28, 2018
72f7539
A better way to filter the broker response for while/blacklists.
Mar 5, 2018
8cb4639
Adding documentation for how to use the label selectors.
Mar 6, 2018
815dba4
Adding whitespace and reordering comments to avoid confusion and delays.
Mar 9, 2018
4bc662a
Changing to use list, adding tests for helper.
Mar 12, 2018
e6c99d8
Call the catalog restriction type ServiceCatalogRestrictions
Mar 14, 2018
bd96336
Call the catalog restriction type ClusterServiceCatalogRestrictions
Mar 14, 2018
25cf545
Document the consts for filter.
Mar 14, 2018
6cdeb3b
document comments are strict.
Mar 15, 2018
48f4444
No comma. I blame Doug.
Mar 15, 2018
84f52a9
Revert "Pass correct plan ID in deprovision request (for both deletin…
Mar 16, 2018
94c89b0
Merge remote-tracking branch 'upstream/master'
Mar 16, 2018
4b7bc89
Merge remote-tracking branch 'upstream/master'
Mar 23, 2018
2e08402
Merge with master.
Mar 23, 2018
f959fd2
Changing types to just be lists of strings. moving some conversion to…
Mar 23, 2018
1590bd8
Getting Can't handle <nil> from the fuzzer.
Mar 23, 2018
ad38b27
just use []string
Mar 26, 2018
ebff045
Merge with master.
Apr 2, 2018
2fe49b8
Fixing up feature gate.
Apr 2, 2018
5785b69
Make the flag generic in the unit test.
Apr 3, 2018
0ce636c
Fix ConvertToSelector comment.
Apr 3, 2018
f0a23ad
Moving convert functions out of conversion.go.
Apr 3, 2018
0eb1529
make it clear we will use for list/relist.
Apr 3, 2018
9dcfa79
Fix comment for NewPredicate
Apr 3, 2018
76b5450
Fix CatalogRestrictions comment.
Apr 3, 2018
9039cf0
fix openapi.
Apr 3, 2018
5de5989
fix ConvertCluster function comments
Apr 3, 2018
d33b2a0
Update comment in type.
Apr 4, 2018
4285b72
Remove the old test no longer needed.
Apr 4, 2018
7144232
move filter test code to the new file location.
Apr 4, 2018
b6507f8
Forgot the C header.
Apr 4, 2018
71a7d85
copy godoc for unversioned type.
Apr 4, 2018
d6f8448
Reword commend from feedback.
Apr 4, 2018
88022e6
Open api changed after generation. update.
Apr 4, 2018
114dcb1
upate comments.
Apr 4, 2018
1b105b4
adding integration test, super simple.
Apr 5, 2018
ce24688
Merge branch 'master' into whitelist_from_labels
n3wscott Apr 16, 2018
5e9e946
fmt'ed the features.
Apr 16, 2018
b7276aa
yolo, no flag.
Apr 16, 2018
60650e8
Rework integration test to not assume the flag.
Apr 16, 2018
e3aed41
Remove more cruft from the flag.
Apr 17, 2018
63f5691
Merge branch 'master' into whitelist_from_labels
Apr 19, 2018
14c39d1
godocs match 100% now.
Apr 19, 2018
6cbedc4
Generator generated.
Apr 20, 2018
0b99c5d
Merge remote-tracking branch 'upstream/master' into whitelist_from_la…
Apr 20, 2018
a75f8ee
ran deps ensure, got this
Apr 20, 2018
362278f
Merge with master.
Apr 20, 2018
dfdabaa
Revert sort of... back to k8s 1.10 gen.
Apr 20, 2018
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
9 changes: 9 additions & 0 deletions pkg/apis/servicecatalog/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ type CommonServiceBrokerSpec struct {
// RelistRequests is a strictly increasing, non-negative integer counter that
// can be manually incremented by a user to manually trigger a relist.
RelistRequests int64

// CatalogRestrictions allows adding restrictions onto Class/Plans on relist.
CatalogRestrictions *CatalogRestrictions
}

// CatalogRestrictions holds the restriction for service class and plan.
type CatalogRestrictions struct {
ServicePlan []string
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: copy godoc in from v1beta1 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

ServiceClass []string
}

// ClusterServiceBrokerSpec represents a description of a Broker.
Expand Down
36 changes: 35 additions & 1 deletion pkg/apis/servicecatalog/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ limitations under the License.

package v1beta1

import "fmt"
import (
"fmt"

"github.com/kubernetes-incubator/service-catalog/pkg/filter"
"k8s.io/apimachinery/pkg/labels"
)

// These functions are used for field selectors. They are only needed if
// field selection is made available for types, hence we only have them for
Expand Down Expand Up @@ -88,3 +93,32 @@ func ServiceInstanceFieldLabelConversionFunc(label, value string) (string, strin
return "", "", fmt.Errorf("field label not supported: %s", label)
}
}

// ConvertClusterServiceClassToProperties takes a Service Class and pulls out the
// properties we support for filtering, converting them into a map in the
// expected format.
func ConvertClusterServiceClassToProperties(serviceClass *ClusterServiceClass) filter.Properties {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't the conversion for this generated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this whole class is hand written... I am not aware of a generator that flattens objects. Is there one? We might not want to use it because we are only wanting to look at a couple fields

Copy link
Contributor

Choose a reason for hiding this comment

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

I think my question is more accurately stated as: "Did the code generation that's invoked by the makefile not handle these fields correctly?"

Handwritten conversions are hard to maintain - so if we can avoid writing them, that is preferable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I understand what's happening now. This method is not part of the 'API conversions' per se, but is a utility method to produce a filter.Properties from a given ClusterServiceClass, right?

if serviceClass == nil {
return labels.Set{}
}
return labels.Set{
FilterName: serviceClass.Name,
FilterSpecExternalName: serviceClass.Spec.ExternalName,
FilterSpecExternalID: serviceClass.Spec.ExternalID,
}
}

// ConvertServicePlanToProperties takes a Service Plan and pulls out the
// properties we support for filtering, converting them into a map in the
// expected format.
func ConvertClusterServicePlanToProperties(servicePlan *ClusterServicePlan) filter.Properties {
if servicePlan == nil {
return labels.Set{}
}
return labels.Set{
FilterName: servicePlan.Name,
FilterSpecExternalName: servicePlan.Spec.ExternalName,
FilterSpecExternalID: servicePlan.Spec.ExternalID,
FilterSpecClusterServiceClassName: servicePlan.Spec.ClusterServiceClassRef.Name,
}
}
131 changes: 131 additions & 0 deletions pkg/apis/servicecatalog/v1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ limitations under the License.
package v1beta1

import (
"encoding/json"
"strings"
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog"
)

type conversionFunc func(string, string) (string, string, error)
Expand Down Expand Up @@ -235,3 +240,129 @@ func runTestCases(t *testing.T, cases []testcase, testFuncName string, testFunc
}
}
}

func TestConvert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions_AndBack(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this test needs to exist - am I missing something, possibly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:D they use to not match types and I hand wrote a converter

I can remove

originalIn := CatalogRestrictions{
ServiceClass: []string{"name not in (foo)"},
ServicePlan: []string{"name == bar", "externalName==baz"},
}
var originalOut servicecatalog.CatalogRestrictions

Convert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions(&originalIn, &originalOut, nil)

var convertedOut CatalogRestrictions

Convert_servicecatalog_CatalogRestrictions_To_v1beta1_CatalogRestrictions(&originalOut, &convertedOut, nil)

// original in and converted out should match, but string formatting and order modifications are allowed.

for _, r := range convertedOut.ServiceClass {
if !findInRequirementsIgnoreSpaces(r, originalIn.ServiceClass) {
t.Fail()
}
}

for _, r := range convertedOut.ServicePlan {
if !findInRequirementsIgnoreSpaces(r, originalIn.ServicePlan) {
t.Fail()
}
}
}

func findInRequirementsIgnoreSpaces(requirement string, requirements []string) bool {
find := strings.Replace(requirement, " ", "", -1)
for _, r := range requirements {
found := strings.Replace(r, " ", "", -1)
if find == found {
return true
}
}
return false
}

func TestConvertClusterServiceClassToProperties(t *testing.T) {
cases := []struct {
name string
sc *ClusterServiceClass
json string
}{
{
name: "nil object",
json: "{}",
},
{
name: "normal object",
sc: &ClusterServiceClass{
ObjectMeta: metav1.ObjectMeta{Name: "service-class"},
Spec: ClusterServiceClassSpec{
CommonServiceClassSpec: CommonServiceClassSpec{
ExternalName: "external-class-name",
ExternalID: "external-id",
},
},
},
json: "{\"name\":\"service-class\",\"spec.externalID\":\"external-id\",\"spec.externalName\":\"external-class-name\"}",
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use a backticks string here to make this a lot more readable, just fyi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice! thanks, I had not tried yet

},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
p := ConvertClusterServiceClassToProperties(tc.sc)
if p == nil {
t.Fatalf("Failed to create Properties object from %+v", tc.sc)
}
b, err := json.Marshal(p)
if err != nil {
t.Fatalf("Unexpected error with json marchal, %v", err)
}
js := string(b)
if js != tc.json {
t.Fatalf("Failed to create expected Properties object,\n\texpected: \t%q,\n \tgot: \t\t%q", tc.json, js)
}
})
}
}

func TestConvertClusterServicePlanToProperties(t *testing.T) {
cases := []struct {
name string
sp *ClusterServicePlan
json string
}{
{
name: "nil object",
json: "{}",
},
{
name: "normal object",
sp: &ClusterServicePlan{
ObjectMeta: metav1.ObjectMeta{Name: "service-plan"},
Spec: ClusterServicePlanSpec{
CommonServicePlanSpec: CommonServicePlanSpec{
ExternalName: "external-plan-name",
ExternalID: "external-id",
},
ClusterServiceClassRef: ClusterObjectReference{
Name: "cluster-service-class-name",
},
},
},
json: "{\"name\":\"service-plan\",\"spec.clusterServiceClass.name\":\"cluster-service-class-name\",\"spec.externalID\":\"external-id\",\"spec.externalName\":\"external-plan-name\"}",
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
p := ConvertClusterServicePlanToProperties(tc.sp)
if p == nil {
t.Fatalf("Failed to create Properties object from %+v", tc.sp)
}
b, err := json.Marshal(p)
if err != nil {
t.Fatalf("Unexpected error with json marchal, %v", err)
}
js := string(b)
if js != tc.json {
t.Fatalf("Failed to create expected Properties object,\n\texpected: \t%q,\n \tgot: \t\t%q", tc.json, js)
}
})
}
}
63 changes: 63 additions & 0 deletions pkg/apis/servicecatalog/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,57 @@ type CommonServiceBrokerSpec struct {
// can be manually incremented by a user to manually trigger a relist.
// +optional
RelistRequests int64 `json:"relistRequests"`

// CatalogRestrictions allows adding restrictions onto Class/Plans on relist.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change the wording here a little to:

// CatalogRestrictions is a set of restrictions on which of a broker's services and plans have resources created for them.

Copy link
Contributor

Choose a reason for hiding this comment

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

bump - can we change the wording here?

// +optional
CatalogRestrictions *CatalogRestrictions `json:"catalogRestrictions,omitempty"`
}

// ServiceCatalogRestrictions contains the restrictions used to on catalog re-list.
// Some examples of this object are as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

It needs to be more clear that the restriction expressions are in terms of the k8s API resources. It would also be more correct to say spec.externalName than externalName.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good call. I think we should make that clear. I had this with field selectors and it got lost when I was attempting label selectors. I can add it back. Then free = true makes a lot more sense when it is next to spec.externalName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

//
// This is an example of a whitelist on service externalName.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a blacklist not a whitelist, right? It is explicit blocking FooService and BarService.

Copy link
Contributor

@eriknelson eriknelson Mar 9, 2018

Choose a reason for hiding this comment

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

I think this could be interpreted in a couple ways: either "Allow all services that are NOT Foo/BarService", which would be an allowance rule and a whitelist. However, ultimately what you're saying here is "Block FooService and BarService", which sounds much more like a blacklist to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment may be confusing, I am staying the previous solution is the whitelist.

Above example is whitelist: "externalName in (FooService, BarService)"

Below example is a blacklist: "externalName notin (FooService, BarService)",

in means the thing must be contained in the following list to pass the predicate.
notin means the thing must not be contained in the following list to pass the predicate.

I hope it is just confusion around the Goal, Solution, and English Description format. I can fix that.

@staebler @eriknelson

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or you folks are getting caught up on the restrictions name. In that case, I am open to other names that are allowed to house both white and black lists together, example: "externalName in (Demo),name not in (AABBCC)"

Copy link
Contributor

Choose a reason for hiding this comment

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

@n3wscott this is getting kind of pedantic, but I interpret a blacklist as "allow everything but these", compared to a whitelist that is "Allow nothing, but pass these". The distinction being a default allowing everything, or nothing. Given that definition, your examples are exactly correct, and the comment is describing a blacklist.

Copy link
Contributor

@staebler staebler Mar 9, 2018

Choose a reason for hiding this comment

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

@n3wscott OK. The confusion for me was the ordering of the comments. I read it to apply to the following rather than the preceding. An empty line between each example would have made it less confusing for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

@n3wscott And, for what it's worth, I had no problem understanding the examples. I don't think that there is a need to change the restrictions name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok updated to hopefully clear this up.

this is getting kind of pedantic

:D

@eriknelson we are staying the same thing and we agree. I updated the comment order and added whitespace to clear this up.

Copy link
Contributor

Choose a reason for hiding this comment

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

ack, sounds good.

// Goal: Only list Services with the externalName of FooService and BarService,
// Solution: restrictions := ServiceCatalogRestrictions{
// ServiceClass: ["externalName in (FooService, BarService)"]
// }
//
// This is an example of a blacklist on service externalName.
// Goal: Allow all services except the ones with the externalName of FooService and BarService,
// Solution: restrictions := ServiceCatalogRestrictions{
// ServiceClass: ["externalName notin (FooService, BarService)"]
// }
//
// This whitelists plans called "Demo", and blacklists (but only a single element in
// the list) a service and a plan.
// Goal: Allow all plans with the externalName demo, but not AABBCC, and not a specific service by name,
// Solution: restrictions := ServiceCatalogRestrictions{
// ServiceClass: ["name!=AABBB-CCDD-EEGG-HIJK"]
// ServicePlan: ["externalName in (Demo)", "name!=AABBCC"]
// }
//
// CatalogRestrictions strings have a special format similar to Label Selectors,
// except the catalog supports only a very specific property set.
//
// The predicate format is expected to be `<property><conditional><requirement>`
// Check the *Requirements type definition for which <property> strings will be allowed.
// <conditional> is allowed to be one of the following: ==, !=, in, notin
// <requirement> will be a string value if `==` or `!=` are used.
// <requirement> will be a set of string values if `in` or `notin` are used.
// Multiple predicates are allowed to be chained with a comma (,)
//
// ServiceClass allowed property names:
// name - the value set to [Cluster]ServiceClass.Name
// externalName - the value set to [Cluster]ServiceClass.Spec.ExternalName
//
// ServicePlan allowed property names:
// name - the value set to [Cluster]ServiceClass.Name
// externalName - the value set to [Cluster]ServiceClass.Spec.ExternalName
type CatalogRestrictions struct {
// ServiceClass represents a selector for plans, used to filter catalog re-lists.
ServiceClass []string `json:"serviceClass,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note I removed custom typed strings because it was not adding value to the code.

// ServicePlan represents a selector for classes, used to filter catalog re-lists.
ServicePlan []string `json:"servicePlan,omitempty"`
}

// ClusterServiceBrokerSpec represents a description of a Broker.
Expand Down Expand Up @@ -1241,6 +1292,18 @@ type ClusterObjectReference struct {
Name string `json:"name,omitempty"`
}

// Filter path for Properties
const (
// Name field.
FilterName = "name"
// SpecExternalName is the external name of the object.
FilterSpecExternalName = "spec.externalName"
// SpecExternalID is the external id of the object.
FilterSpecExternalID = "spec.externalID"
// SpecClusterServiceClassName is only used for plans, the parent service class name.
FilterSpecClusterServiceClassName = "spec.clusterServiceClass.name"
)

// SecretTransform is a single transformation that is applied to the
// credentials returned from the broker before they are inserted into
// the Secret associated with the ServiceBinding.
Expand Down
26 changes: 26 additions & 0 deletions pkg/apis/servicecatalog/v1beta1/zz_generated.conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_servicecatalog_BasicAuthConfig_To_v1beta1_BasicAuthConfig,
Convert_v1beta1_BearerTokenAuthConfig_To_servicecatalog_BearerTokenAuthConfig,
Convert_servicecatalog_BearerTokenAuthConfig_To_v1beta1_BearerTokenAuthConfig,
Convert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions,
Convert_servicecatalog_CatalogRestrictions_To_v1beta1_CatalogRestrictions,
Convert_v1beta1_ClusterBasicAuthConfig_To_servicecatalog_ClusterBasicAuthConfig,
Convert_servicecatalog_ClusterBasicAuthConfig_To_v1beta1_ClusterBasicAuthConfig,
Convert_v1beta1_ClusterBearerTokenAuthConfig_To_servicecatalog_ClusterBearerTokenAuthConfig,
Expand Down Expand Up @@ -195,6 +197,28 @@ func Convert_servicecatalog_BearerTokenAuthConfig_To_v1beta1_BearerTokenAuthConf
return autoConvert_servicecatalog_BearerTokenAuthConfig_To_v1beta1_BearerTokenAuthConfig(in, out, s)
}

func autoConvert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions(in *CatalogRestrictions, out *servicecatalog.CatalogRestrictions, s conversion.Scope) error {
out.ServiceClass = *(*[]string)(unsafe.Pointer(&in.ServiceClass))
out.ServicePlan = *(*[]string)(unsafe.Pointer(&in.ServicePlan))
return nil
}

// Convert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions is an autogenerated conversion function.
func Convert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions(in *CatalogRestrictions, out *servicecatalog.CatalogRestrictions, s conversion.Scope) error {
return autoConvert_v1beta1_CatalogRestrictions_To_servicecatalog_CatalogRestrictions(in, out, s)
}

func autoConvert_servicecatalog_CatalogRestrictions_To_v1beta1_CatalogRestrictions(in *servicecatalog.CatalogRestrictions, out *CatalogRestrictions, s conversion.Scope) error {
out.ServicePlan = *(*[]string)(unsafe.Pointer(&in.ServicePlan))
out.ServiceClass = *(*[]string)(unsafe.Pointer(&in.ServiceClass))
return nil
}

// Convert_servicecatalog_CatalogRestrictions_To_v1beta1_CatalogRestrictions is an autogenerated conversion function.
func Convert_servicecatalog_CatalogRestrictions_To_v1beta1_CatalogRestrictions(in *servicecatalog.CatalogRestrictions, out *CatalogRestrictions, s conversion.Scope) error {
return autoConvert_servicecatalog_CatalogRestrictions_To_v1beta1_CatalogRestrictions(in, out, s)
}

func autoConvert_v1beta1_ClusterBasicAuthConfig_To_servicecatalog_ClusterBasicAuthConfig(in *ClusterBasicAuthConfig, out *servicecatalog.ClusterBasicAuthConfig, s conversion.Scope) error {
out.SecretRef = (*servicecatalog.ObjectReference)(unsafe.Pointer(in.SecretRef))
return nil
Expand Down Expand Up @@ -602,6 +626,7 @@ func autoConvert_v1beta1_CommonServiceBrokerSpec_To_servicecatalog_CommonService
out.RelistBehavior = servicecatalog.ServiceBrokerRelistBehavior(in.RelistBehavior)
out.RelistDuration = (*v1.Duration)(unsafe.Pointer(in.RelistDuration))
out.RelistRequests = in.RelistRequests
out.CatalogRestrictions = (*servicecatalog.CatalogRestrictions)(unsafe.Pointer(in.CatalogRestrictions))
return nil
}

Expand All @@ -617,6 +642,7 @@ func autoConvert_servicecatalog_CommonServiceBrokerSpec_To_v1beta1_CommonService
out.RelistBehavior = ServiceBrokerRelistBehavior(in.RelistBehavior)
out.RelistDuration = (*v1.Duration)(unsafe.Pointer(in.RelistDuration))
out.RelistRequests = in.RelistRequests
out.CatalogRestrictions = (*CatalogRestrictions)(unsafe.Pointer(in.CatalogRestrictions))
return nil
}

Expand Down
35 changes: 35 additions & 0 deletions pkg/apis/servicecatalog/v1beta1/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ func (in *BearerTokenAuthConfig) DeepCopy() *BearerTokenAuthConfig {
return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CatalogRestrictions) DeepCopyInto(out *CatalogRestrictions) {
*out = *in
if in.ServiceClass != nil {
in, out := &in.ServiceClass, &out.ServiceClass
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.ServicePlan != nil {
in, out := &in.ServicePlan, &out.ServicePlan
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogRestrictions.
func (in *CatalogRestrictions) DeepCopy() *CatalogRestrictions {
if in == nil {
return nil
}
out := new(CatalogRestrictions)
in.DeepCopyInto(out)
return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterBasicAuthConfig) DeepCopyInto(out *ClusterBasicAuthConfig) {
*out = *in
Expand Down Expand Up @@ -493,6 +519,15 @@ func (in *CommonServiceBrokerSpec) DeepCopyInto(out *CommonServiceBrokerSpec) {
**out = **in
}
}
if in.CatalogRestrictions != nil {
in, out := &in.CatalogRestrictions, &out.CatalogRestrictions
if *in == nil {
*out = nil
} else {
*out = new(CatalogRestrictions)
(*in).DeepCopyInto(*out)
}
}
return
}

Expand Down
Loading