Skip to content

Commit 46f1b59

Browse files
committed
Implement ClusterWithContext
Signed-off-by: Nelo-T. Wallus <[email protected]>
1 parent f47ea29 commit 46f1b59

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dynamic/dynamicinformer/informer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,12 @@ func (d *dynamicClusterInformer) Lister() kcpcache.GenericClusterLister {
165165
}
166166

167167
func (d *dynamicClusterInformer) Cluster(clusterName logicalcluster.Name) upstreaminformers.GenericInformer {
168+
return d.ClusterWithContext(context.Background(), clusterName)
169+
}
170+
171+
func (d *dynamicClusterInformer) ClusterWithContext(ctx context.Context, clusterName logicalcluster.Name) upstreaminformers.GenericInformer {
168172
return &dynamicInformer{
169-
informer: d.Informer().Cluster(clusterName),
173+
informer: d.Informer().ClusterWithContext(ctx, clusterName),
170174
lister: d.Lister().ByCluster(clusterName),
171175
}
172176
}

metadata/metadatainformer/informer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,12 @@ func (d *metadataClusterInformer) Lister() kcpcache.GenericClusterLister {
165165
}
166166

167167
func (d *metadataClusterInformer) Cluster(clusterName logicalcluster.Name) upstreaminformers.GenericInformer {
168+
return d.ClusterWithContext(context.Background(), clusterName)
169+
}
170+
171+
func (d *metadataClusterInformer) ClusterWithContext(ctx context.Context, clusterName logicalcluster.Name) upstreaminformers.GenericInformer {
168172
return &metadataInformer{
169-
informer: d.Informer().Cluster(clusterName),
173+
informer: d.Informer().ClusterWithContext(ctx, clusterName),
170174
lister: d.Lister().ByCluster(clusterName),
171175
}
172176
}

0 commit comments

Comments
 (0)