Merge pull request #7129 from junnplus/namespace-service

fix incorrect namespace of event when create/update namespace
This commit is contained in:
Derek McGowan 2023-01-19 22:49:28 -08:00 committed by GitHub
commit beabd3d5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,6 +135,7 @@ func (l *local) Create(ctx context.Context, req *api.CreateNamespaceRequest, _ .
return &resp, err
}
ctx = namespaces.WithNamespace(ctx, req.Namespace.Name)
if err := l.publisher.Publish(ctx, "/namespaces/create", &eventstypes.NamespaceCreate{
Name: req.Namespace.Name,
Labels: req.Namespace.Labels,
@ -188,6 +189,7 @@ func (l *local) Update(ctx context.Context, req *api.UpdateNamespaceRequest, _ .
return &resp, err
}
ctx = namespaces.WithNamespace(ctx, req.Namespace.Name)
if err := l.publisher.Publish(ctx, "/namespaces/update", &eventstypes.NamespaceUpdate{
Name: req.Namespace.Name,
Labels: req.Namespace.Labels,