Skip to content

Commit 24267e7

Browse files
committed
Add ClusterWithContext
Signed-off-by: Nelo-T. Wallus <[email protected]>
1 parent 5ae6774 commit 24267e7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

metadata/clientset.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path) metadata.Int
4343
return c.clientCache.ClusterOrDie(clusterPath)
4444
}
4545

46+
// ClusterWithContext is only implemented to satisfy the
47+
// ClusterInterface and silently ignores the context, the client is not
48+
// actually context aware.
49+
func (c *ClusterClientset) ClusterWithContext(ctx context.Context, clusterPath logicalcluster.Path) metadata.Interface {
50+
return c.clientCache.ClusterOrDie(clusterPath)
51+
}
52+
4653
func (c *ClusterClientset) Resource(resource schema.GroupVersionResource) ResourceClusterInterface {
4754
return &ClusterResourceClient{clientCache: c.clientCache, resource: resource}
4855
}

metadata/interface.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929

3030
type ClusterInterface interface {
3131
Cluster(logicalcluster.Path) metadata.Interface
32+
ClusterWithContext(context.Context, logicalcluster.Path) metadata.Interface
3233
Resource(resource schema.GroupVersionResource) ResourceClusterInterface
3334
}
3435

0 commit comments

Comments
 (0)