From 14c36cca600672a0296e8d0db53a846887334155 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 14 Sep 2017 13:21:37 -0400 Subject: [PATCH] Set ctx ns before publish Fixes #1497 This sets the namespace on the context when deleting a namespace so that the publish event does not fail. Use the same namespace as you are deleting for the context. Signed-off-by: Michael Crosby --- services/namespaces/service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/namespaces/service.go b/services/namespaces/service.go index 0891670cb..efd1e4642 100644 --- a/services/namespaces/service.go +++ b/services/namespaces/service.go @@ -187,7 +187,8 @@ func (s *Service) Delete(ctx context.Context, req *api.DeleteNamespaceRequest) ( }); err != nil { return &empty.Empty{}, err } - + // set the namespace in the context before publishing the event + ctx = namespaces.WithNamespace(ctx, req.Name) if err := s.publisher.Publish(ctx, "/namespaces/delete", &eventsapi.NamespaceDelete{ Name: req.Name, }); err != nil {