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

Commit

Permalink
Downgrade default OSB version to 2.13 (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
polskikiel authored Jun 16, 2020
1 parent ac5be40 commit fae2372
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ go run cmd/broker/main.go
Now you can test the Broker using the **/v2/catalog** endpoint.

```bash
curl -H "X-Broker-API-Version: 2.14" localhost:8080/cluster/v2/catalog
curl -H "X-Broker-API-Version: 2.13" localhost:8080/cluster/v2/catalog
```

5. Start the Controller:
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ require (
github.com/hashicorp/go-getter v1.4.1
github.com/hashicorp/go-multierror v1.1.0
github.com/huandu/xstrings v1.3.1 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/imdario/mergo v0.3.9
github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8
github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20190909175253-906fa5f9c249
github.com/kubernetes-sigs/service-catalog v0.3.0
github.com/kyma-project/kyma v0.5.1-0.20200317154738-0bb20217c2cb
github.com/kyma-project/rafter v0.0.0-20200413150919-1a89277ac3d8
Expand Down
7 changes: 1 addition & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ github.com/SpectoLabs/hoverfly v1.1.5/go.mod h1:vRr0EmJr3iSlHUcW6M0dXNrJJlBngdKF
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/alecthomas/jsonschema v0.0.0-20200123075451-43663a393755 h1:+xHAcx6b5TS1DiY+StyK2CrNvD0nQ97G7w45x4ljJFs=
github.com/alecthomas/jsonschema v0.0.0-20200123075451-43663a393755/go.mod h1:Juc2PrI3wtNfUwptSvAIeNx+HrETwHQs6nf+TkOJlOA=
github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 h1:T3+cD5fYvuH36h7EZq+TDpm+d8a6FSD4pQsbmuGGQ8o=
github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down Expand Up @@ -291,8 +289,6 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs=
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=
Expand Down Expand Up @@ -328,9 +324,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20190909175253-906fa5f9c249 h1:nQkW5khoOU4DC5ORWqvOlVh4oGxYPT6j6134cPIVm5Q=
github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20190909175253-906fa5f9c249/go.mod h1:s8wBC55/DEkNa3YMY1WLgpT33Ghpmw7v+waIxh15dYI=
github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8 h1:37JsHMAiuoyIFPyYUJ6jOTXznsmcDZec6tkPod+Tqto=
github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M=
github.com/kubernetes-sigs/service-catalog v0.3.0 h1:uQaQcWnJf2qJ0ODaKHktOMN0daF+hi3inqrXzACyI1Y=
github.com/kubernetes-sigs/service-catalog v0.3.0/go.mod h1:zRfgMd1T9HuXR24Qj4GOu/TGWABVGw62MGlyHVcpWnU=
github.com/kyma-project/kyma v0.5.1-0.20200317154738-0bb20217c2cb h1:hxOth4M0qtQk7DmLkjosR1nwRdv5izgTtsBTZSbkIVU=
Expand Down
6 changes: 4 additions & 2 deletions internal/broker/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ func (f *addonToServiceConverter) mapToParametersSchemas(planSchemas map[interna
}
if schema, exists := planSchemas[internal.SchemaTypeBind]; exists {
out.ServiceBinding = &osb.ServiceBindingSchema{
Create: &osb.InputParametersSchema{
Parameters: schema,
Create: &osb.RequestResponseSchema{
InputParametersSchema: osb.InputParametersSchema{
Parameters: schema,
},
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/broker/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
type contextKey int

const (
osbAPIVersion = "2.14"
osbAPIVersion = "2.13"

osbContextKey contextKey = 5001
)
Expand Down
2 changes: 1 addition & 1 deletion internal/broker/dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/pkg/errors"
)

// DTOs for Open Service Broker v2.14 API
// DTOs for Open Service Broker v2.13 API

type contextDTO struct {
Platform string `json:"platform"`
Expand Down
4 changes: 2 additions & 2 deletions internal/broker/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,11 @@ func (srv *Server) writeErrorResponse(w http.ResponseWriter, code int, errorMsg,
func writeErrorResponse(w http.ResponseWriter, code int, errorMsg, desc string) {
dto := struct {
// Error is a machine readable info on an error.
// As of 2.14 Open Broker API spec it's NOT passed to entity querying the catalog.
// As of 2.13 Open Broker API spec it's NOT passed to entity querying the catalog.
Error string `json:"error,optional"`

// Desc is a meaningful error message explaining why the request failed.
// see: https://github.com/openservicebrokerapi/servicebroker/blob/v2.14/spec.md#broker-errors
// see: https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#broker-errors
Desc string `json:"description,optional"`
}{}

Expand Down

0 comments on commit fae2372

Please sign in to comment.