From 12cad63df8bd0b537f0788c68161985fc8809874 Mon Sep 17 00:00:00 2001 From: Nicolaas Hyatt <39059405+TheSp1der@users.noreply.github.com> Date: Thu, 11 Jul 2024 05:43:43 -0500 Subject: [PATCH] fix: adds endpoint to support get-binding response for OSB v2.16 (#321) * Adds endpoint to support get-binding response for OSB v2.16 * add endpoints to responder-handler * moves Endpoints to BindingResponse * Adds endpoints to binding response --- domain/apiresponses/responses.go | 1 + domain/service_broker.go | 8 ++++++++ handlers/bind.go | 2 ++ handlers/get_binding.go | 1 + 4 files changed, 12 insertions(+) diff --git a/domain/apiresponses/responses.go b/domain/apiresponses/responses.go index 9c22c661..0b8f8525 100644 --- a/domain/apiresponses/responses.go +++ b/domain/apiresponses/responses.go @@ -67,6 +67,7 @@ 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 { diff --git a/domain/service_broker.go b/domain/service_broker.go index b19dde2f..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 { @@ -206,6 +207,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 { 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 cf55992c..d7edc008 100644 --- a/handlers/get_binding.go +++ b/handlers/get_binding.go @@ -59,6 +59,7 @@ 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, })