From cc2bfbe075a679680149099b30e8edcd472f2a9f Mon Sep 17 00:00:00 2001 From: Tara Gu Date: Wed, 10 Jul 2019 02:46:25 -0400 Subject: [PATCH] Pass service instance name via ProvisionRequest context (#2669) --- pkg/controller/controller_binding.go | 1 + pkg/controller/controller_instance.go | 1 + pkg/controller/controller_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/pkg/controller/controller_binding.go b/pkg/controller/controller_binding.go index fa4facfab77..10330099314 100644 --- a/pkg/controller/controller_binding.go +++ b/pkg/controller/controller_binding.go @@ -1218,6 +1218,7 @@ func (c *controller) prepareBindRequest( "platform": ContextProfilePlatformKubernetes, "namespace": instance.Namespace, clusterIdentifierKey: clusterID, + "instance_name": instance.Name, } request := &osb.BindRequest{ diff --git a/pkg/controller/controller_instance.go b/pkg/controller/controller_instance.go index db3e556e07c..1cb350d9dca 100644 --- a/pkg/controller/controller_instance.go +++ b/pkg/controller/controller_instance.go @@ -2211,6 +2211,7 @@ func (c *controller) prepareRequestHelper(instance *v1beta1.ServiceInstance, pla "platform": ContextProfilePlatformKubernetes, "namespace": instance.Namespace, clusterIdentifierKey: id, + "instance_name": instance.Name, } return rh, nil } diff --git a/pkg/controller/controller_test.go b/pkg/controller/controller_test.go index 4c6bf4ddb0d..b3bf9e038a7 100644 --- a/pkg/controller/controller_test.go +++ b/pkg/controller/controller_test.go @@ -98,6 +98,7 @@ var ( testContext = map[string]interface{}{ "platform": ContextProfilePlatformKubernetes, "namespace": testNamespace, + "instance_name": testServiceInstanceName, clusterIdentifierKey: testClusterID, } )