Skip to content

Commit f2c2302

Browse files
committed
generate clusterEvent queue key in a separate function
1 parent 5967837 commit f2c2302

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/controller/controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/Sirupsen/logrus"
88
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9+
"k8s.io/apimachinery/pkg/types"
910
"k8s.io/client-go/pkg/api/v1"
1011
"k8s.io/client-go/rest"
1112
"k8s.io/client-go/tools/cache"
@@ -169,7 +170,7 @@ func (c *Controller) initController() {
169170
return "", fmt.Errorf("could not cast to ClusterEvent")
170171
}
171172

172-
return fmt.Sprintf("%s-%s", e.EventType, e.UID), nil
173+
return queueClusterKey(e.EventType, e.UID), nil
173174
})
174175
}
175176

@@ -206,3 +207,7 @@ func (c *Controller) runPostgresqlInformer(stopCh <-chan struct{}, wg *sync.Wait
206207

207208
c.postgresqlInformer.Run(stopCh)
208209
}
210+
211+
func queueClusterKey(eventType spec.EventType, uid types.UID) string {
212+
return fmt.Sprintf("%s-%s", eventType, uid)
213+
}

0 commit comments

Comments
 (0)