generate clusterEvent queue key in a separate function
This commit is contained in:
		
							parent
							
								
									5967837875
								
							
						
					
					
						commit
						f2c23021bb
					
				|  | @ -6,6 +6,7 @@ import ( | ||||||
| 
 | 
 | ||||||
| 	"github.com/Sirupsen/logrus" | 	"github.com/Sirupsen/logrus" | ||||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||||
|  | 	"k8s.io/apimachinery/pkg/types" | ||||||
| 	"k8s.io/client-go/pkg/api/v1" | 	"k8s.io/client-go/pkg/api/v1" | ||||||
| 	"k8s.io/client-go/rest" | 	"k8s.io/client-go/rest" | ||||||
| 	"k8s.io/client-go/tools/cache" | 	"k8s.io/client-go/tools/cache" | ||||||
|  | @ -169,7 +170,7 @@ func (c *Controller) initController() { | ||||||
| 				return "", fmt.Errorf("could not cast to ClusterEvent") | 				return "", fmt.Errorf("could not cast to ClusterEvent") | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			return fmt.Sprintf("%s-%s", e.EventType, e.UID), nil | 			return queueClusterKey(e.EventType, e.UID), nil | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -206,3 +207,7 @@ func (c *Controller) runPostgresqlInformer(stopCh <-chan struct{}, wg *sync.Wait | ||||||
| 
 | 
 | ||||||
| 	c.postgresqlInformer.Run(stopCh) | 	c.postgresqlInformer.Run(stopCh) | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func queueClusterKey(eventType spec.EventType, uid types.UID) string { | ||||||
|  | 	return fmt.Sprintf("%s-%s", eventType, uid) | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue