Skip to content

Commit

Permalink
Merge pull request #13535 from jim-minter/templateservicebroker_updates
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Mar 25, 2017
2 parents ec459b4 + 2d63281 commit 9b26d5a
Show file tree
Hide file tree
Showing 77 changed files with 4,379 additions and 644 deletions.
24 changes: 24 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/cmd/server/origin/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (c *MasterConfig) InstallProtectedAPI(apiserver *genericapiserver.GenericAP
initVersionRoute(apiContainer.Container, "/version/openshift")

if c.Options.EnableTemplateServiceBroker {
openservicebrokerserver.Route(apiContainer.Container, templateapi.ServiceBrokerRoot, templateservicebroker.NewBroker(&c.PrivilegedLoopbackClientConfig, c.PrivilegedLoopbackKubernetesClientset, c.Informers, c.Options.PolicyConfig.OpenShiftSharedResourcesNamespace))
openservicebrokerserver.Route(apiContainer.Container, templateapi.ServiceBrokerRoot, templateservicebroker.NewBroker(&c.PrivilegedLoopbackClientConfig, c.PrivilegedLoopbackOpenShiftClient, c.PrivilegedLoopbackKubernetesClientset, c.Informers, c.Options.PolicyConfig.OpenShiftSharedResourcesNamespace))
}

// Set up OAuth metadata only if we are configured to use OAuth
Expand Down
14 changes: 7 additions & 7 deletions pkg/openapi/zz_generated.openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -24079,10 +24079,10 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
Dependencies: []string{
"unversioned.ListMeta", "v1.TemplateInstance"},
},
"v1.TemplateInstanceRequestor": {
"v1.TemplateInstanceRequester": {
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "TemplateInstanceRequestor holds the identity of an agent requesting a template instantiation.",
Description: "TemplateInstanceRequester holds the identity of an agent requesting a template instantiation.",
Properties: map[string]spec.Schema{
"username": {
SchemaProps: spec.SchemaProps{
Expand Down Expand Up @@ -24114,18 +24114,18 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
Ref: spec.MustCreateRef("#/definitions/v1.LocalObjectReference"),
},
},
"requestor": {
"requester": {
SchemaProps: spec.SchemaProps{
Description: "requestor holds the identity of the agent requesting the template instantiation.",
Ref: spec.MustCreateRef("#/definitions/v1.TemplateInstanceRequestor"),
Description: "requester holds the identity of the agent requesting the template instantiation.",
Ref: spec.MustCreateRef("#/definitions/v1.TemplateInstanceRequester"),
},
},
},
Required: []string{"template", "secret", "requestor"},
Required: []string{"template", "secret", "requester"},
},
},
Dependencies: []string{
"v1.LocalObjectReference", "v1.Template", "v1.TemplateInstanceRequestor"},
"v1.LocalObjectReference", "v1.Template", "v1.TemplateInstanceRequester"},
},
"v1.TemplateInstanceStatus": {
Schema: spec.Schema{
Expand Down
4 changes: 4 additions & 0 deletions pkg/openservicebroker/api/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ func BadRequest(err error) *Response {
return NewResponse(http.StatusBadRequest, nil, err)
}

func Forbidden(err error) *Response {
return NewResponse(http.StatusForbidden, nil, err)
}

func InternalServerError(err error) *Response {
return NewResponse(http.StatusInternalServerError, nil, err)
}
20 changes: 20 additions & 0 deletions pkg/openservicebroker/api/types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package api

// from https://github.com/openservicebrokerapi/servicebroker/blob/1d301105c66187b5aa2e061a1264ecf3cbc3d2a0/_spec.md
// and https://github.com/avade/servicebroker/blob/9ef94ce96ca65bfc9ce482d5ea5be0ad62643a84/_spec.md

import (
jsschema "github.com/lestrrat/go-jsschema"
)

const (
XBrokerAPIVersion = "X-Broker-Api-Version"
Expand Down Expand Up @@ -33,6 +38,21 @@ type Plan struct {
Metadata map[string]interface{} `json:"metadata,omitempty"`
Free bool `json:"free,omitempty"`
Bindable bool `json:"bindable,omitempty"`
Schemas Schema `json:"schemas,omitempty"`
}

type Schema struct {
ServiceInstances ServiceInstances `json:"service-instances,omitempty"`
ServiceBindings ServiceBindings `json:"service-bindings,omitempty"`
}

type ServiceInstances struct {
Create map[string]*jsschema.Schema `json:"create,omitempty"`
Update map[string]*jsschema.Schema `json:"update,omitempty"`
}

type ServiceBindings struct {
Create map[string]*jsschema.Schema `json:"create,omitempty"`
}

type CatalogResponse struct {
Expand Down
Loading

0 comments on commit 9b26d5a

Please sign in to comment.