Skip to content

Commit 8822702

Browse files
committed
Return copy of annotations in grpcCatalogSourceDecorator
Signed-off-by: perdasilva <[email protected]>
1 parent 0b7970c commit 8822702

File tree

1 file changed

+7
-1
lines changed
  • pkg/controller/registry/reconciler

1 file changed

+7
-1
lines changed

pkg/controller/registry/reconciler/grpc.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ func (s *grpcCatalogSourceDecorator) Labels() map[string]string {
6363

6464
func (s *grpcCatalogSourceDecorator) Annotations() map[string]string {
6565
// TODO: Maybe something better than just a copy of all annotations would be to have a specific 'podMetadata' section in the CatalogSource?
66-
return s.GetAnnotations()
66+
// Make a copy of the annotations to avoid concurrent write issues
67+
// See https://bugzilla.redhat.com/show_bug.cgi?id=2101357
68+
annotations := make(map[string]string)
69+
for key, value := range s.GetAnnotations() {
70+
annotations[key] = value
71+
}
72+
return annotations
6773
}
6874

6975
func (s *grpcCatalogSourceDecorator) Service() *corev1.Service {

0 commit comments

Comments
 (0)