@@ -59,6 +59,9 @@ const (
59
59
healthCheckUnhealthyThreshold = 10
60
60
initialCacheSyncTimeout = 5 * time .Minute
61
61
clusterCacheControllerName = "cluster-cache-tracker"
62
+
63
+ // ClusterAccessorErrorMessage error message for failing to create cluster accessor.
64
+ ClusterAccessorErrorMessage = "failed to create cluster accessor"
62
65
)
63
66
64
67
// ErrClusterLocked is returned in methods that require cluster-level locking
@@ -267,7 +270,7 @@ func (t *ClusterCacheTracker) getClusterAccessor(ctx context.Context, cluster cl
267
270
// for the cluster at the same time.
268
271
// Return an error if another go routine already tries to create a clusterAccessor.
269
272
if ok := t .clusterLock .TryLock (cluster ); ! ok {
270
- return nil , errors .Wrapf (ErrClusterLocked , "failed to create cluster accessor: failed to get lock for cluster" )
273
+ return nil , errors .Wrapf (ErrClusterLocked , ClusterAccessorErrorMessage )
271
274
}
272
275
defer t .clusterLock .Unlock (cluster )
273
276
@@ -281,7 +284,7 @@ func (t *ClusterCacheTracker) getClusterAccessor(ctx context.Context, cluster cl
281
284
log .V (4 ).Info ("Creating new cluster accessor" )
282
285
accessor , err := t .newClusterAccessor (ctx , cluster , indexes ... )
283
286
if err != nil {
284
- return nil , errors .Wrap (err , "failed to create cluster accessor" )
287
+ return nil , errors .Wrap (err , ClusterAccessorErrorMessage )
285
288
}
286
289
287
290
log .V (4 ).Info ("Storing new cluster accessor" )
0 commit comments