From 63344684942f10f30564a3441a4a28579892b309 Mon Sep 17 00:00:00 2001 From: nhyatt Date: Mon, 1 Jul 2024 11:14:14 -0500 Subject: [PATCH 1/6] Adds endpoint to support get-binding response for OSB v2.16 --- domain/apiresponses/responses.go | 3 ++- domain/service_broker.go | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/domain/apiresponses/responses.go b/domain/apiresponses/responses.go index 9c22c661..7a788f30 100644 --- a/domain/apiresponses/responses.go +++ b/domain/apiresponses/responses.go @@ -71,7 +71,8 @@ type BindingResponse struct { type GetBindingResponse struct { BindingResponse - Parameters any `json:"parameters,omitempty"` + Parameters any `json:"parameters,omitempty"` + Endpoints []domain.Endpoint `json:"endpoints,omitempty"` } type UnbindResponse struct { diff --git a/domain/service_broker.go b/domain/service_broker.go index b19dde2f..80220769 100644 --- a/domain/service_broker.go +++ b/domain/service_broker.go @@ -206,6 +206,13 @@ type GetBindingSpec struct { RouteServiceURL string VolumeMounts []VolumeMount Parameters any + Endpoints []Endpoint +} + +type Endpoint struct { + Host string `json:"host"` + Ports []string `json:"ports"` + Protocol string `json:"protocol,omitempty"` } func (d ProvisionDetails) GetRawContext() json.RawMessage { From 704b9da4282d1aea4a0bfd54f4599240a1f14ce3 Mon Sep 17 00:00:00 2001 From: nhyatt Date: Mon, 1 Jul 2024 13:56:53 -0500 Subject: [PATCH 2/6] retrigger checks From 97a4b15393ffa3ae431be9e8b071fe731b07569b Mon Sep 17 00:00:00 2001 From: nhyatt Date: Mon, 1 Jul 2024 14:47:43 -0500 Subject: [PATCH 3/6] add endpoints to responder-handler --- handlers/get_binding.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers/get_binding.go b/handlers/get_binding.go index cf55992c..1ccaf0b3 100644 --- a/handlers/get_binding.go +++ b/handlers/get_binding.go @@ -61,5 +61,6 @@ func (h APIHandler) GetBinding(w http.ResponseWriter, req *http.Request) { VolumeMounts: binding.VolumeMounts, }, Parameters: binding.Parameters, + Endpoints: binding.Endpoints, }) } From 41797d522444be2d336f5c4f330b9a4717c1df1e Mon Sep 17 00:00:00 2001 From: nhyatt Date: Mon, 1 Jul 2024 15:44:35 -0500 Subject: [PATCH 4/6] corrects formatting (gofmt) --- handlers/get_binding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/get_binding.go b/handlers/get_binding.go index 1ccaf0b3..675a2b54 100644 --- a/handlers/get_binding.go +++ b/handlers/get_binding.go @@ -61,6 +61,6 @@ func (h APIHandler) GetBinding(w http.ResponseWriter, req *http.Request) { VolumeMounts: binding.VolumeMounts, }, Parameters: binding.Parameters, - Endpoints: binding.Endpoints, + Endpoints: binding.Endpoints, }) } From cdd667b6e426e101ef63a463f02bfa0c35bce88b Mon Sep 17 00:00:00 2001 From: nhyatt Date: Wed, 10 Jul 2024 06:25:22 -0500 Subject: [PATCH 5/6] moves Endpoints to BindingResponse --- domain/apiresponses/responses.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domain/apiresponses/responses.go b/domain/apiresponses/responses.go index 7a788f30..0b8f8525 100644 --- a/domain/apiresponses/responses.go +++ b/domain/apiresponses/responses.go @@ -67,12 +67,12 @@ type BindingResponse struct { RouteServiceURL string `json:"route_service_url,omitempty"` VolumeMounts []domain.VolumeMount `json:"volume_mounts,omitempty"` BackupAgentURL string `json:"backup_agent_url,omitempty"` + Endpoints []domain.Endpoint `json:"endpoints,omitempty"` } type GetBindingResponse struct { BindingResponse - Parameters any `json:"parameters,omitempty"` - Endpoints []domain.Endpoint `json:"endpoints,omitempty"` + Parameters any `json:"parameters,omitempty"` } type UnbindResponse struct { From 1f3141e605c357e5cd5493c2deed8d0eff9ef50f Mon Sep 17 00:00:00 2001 From: nhyatt Date: Wed, 10 Jul 2024 08:51:45 -0500 Subject: [PATCH 6/6] Adds endpoints to binding response/ --- domain/service_broker.go | 1 + handlers/bind.go | 2 ++ handlers/get_binding.go | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/domain/service_broker.go b/domain/service_broker.go index 80220769..0e0806c6 100644 --- a/domain/service_broker.go +++ b/domain/service_broker.go @@ -198,6 +198,7 @@ type Binding struct { RouteServiceURL string `json:"route_service_url"` BackupAgentURL string `json:"backup_agent_url,omitempty"` VolumeMounts []VolumeMount `json:"volume_mounts"` + Endpoints []Endpoint `json:"endpoints,omitempty"` } type GetBindingSpec struct { diff --git a/handlers/bind.go b/handlers/bind.go index 1047edcf..c7006ee4 100644 --- a/handlers/bind.go +++ b/handlers/bind.go @@ -88,6 +88,7 @@ func (h APIHandler) Bind(w http.ResponseWriter, req *http.Request) { RouteServiceURL: binding.RouteServiceURL, VolumeMounts: binding.VolumeMounts, BackupAgentURL: binding.BackupAgentURL, + Endpoints: binding.Endpoints, }) return } @@ -138,5 +139,6 @@ func (h APIHandler) Bind(w http.ResponseWriter, req *http.Request) { RouteServiceURL: binding.RouteServiceURL, VolumeMounts: binding.VolumeMounts, BackupAgentURL: binding.BackupAgentURL, + Endpoints: binding.Endpoints, }) } diff --git a/handlers/get_binding.go b/handlers/get_binding.go index 675a2b54..d7edc008 100644 --- a/handlers/get_binding.go +++ b/handlers/get_binding.go @@ -59,8 +59,8 @@ func (h APIHandler) GetBinding(w http.ResponseWriter, req *http.Request) { SyslogDrainURL: binding.SyslogDrainURL, RouteServiceURL: binding.RouteServiceURL, VolumeMounts: binding.VolumeMounts, + Endpoints: binding.Endpoints, }, Parameters: binding.Parameters, - Endpoints: binding.Endpoints, }) }