From 5edaf51ba895a5307a2fd631d3be79071dc58517 Mon Sep 17 00:00:00 2001 From: Mark van der Velden Date: Fri, 10 Apr 2020 09:15:37 +0200 Subject: [PATCH] Stripping hard-coded `eri` prefix from pub-sub subscriptions --- cmd/web/pubsub/gcp/pubsub.go | 1 + cmd/web/pubsub/gcp/pubsub_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/web/pubsub/gcp/pubsub.go b/cmd/web/pubsub/gcp/pubsub.go index 35c6599..c1b57e7 100644 --- a/cmd/web/pubsub/gcp/pubsub.go +++ b/cmd/web/pubsub/gcp/pubsub.go @@ -30,6 +30,7 @@ func NewPubSubSvc(logger logrus.FieldLogger, client *gcppubsub.Client, topicName } labels := svc.subscriptionLabels + svc.subscriptionLabels = svc.subscriptionLabels[0:0] for _, l := range labels { if l == "" { continue diff --git a/cmd/web/pubsub/gcp/pubsub_test.go b/cmd/web/pubsub/gcp/pubsub_test.go index b7cd105..7f17347 100644 --- a/cmd/web/pubsub/gcp/pubsub_test.go +++ b/cmd/web/pubsub/gcp/pubsub_test.go @@ -10,10 +10,10 @@ func TestPubSubSvc_getSubscriptionID(t *testing.T) { labels []string want string }{ - {name: "no label", labels: []string{}, want: "eri"}, - {name: "single label", labels: []string{"a"}, want: "eri-a"}, - {name: "multi label", labels: []string{"a", "b"}, want: "eri-a-b"}, - {name: "multi label skip empty", labels: []string{"a", "", "b"}, want: "eri-a-b"}, + {name: "no label", labels: []string{}, want: ""}, + {name: "single label", labels: []string{"a"}, want: "a"}, + {name: "multi label", labels: []string{"a", "b"}, want: "a-b"}, + {name: "multi label skip empty", labels: []string{"a", "", "b"}, want: "a-b"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {