Skip to content

Commit 12a8fca

Browse files
committed
Add docs
1 parent 5972c55 commit 12a8fca

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

pkg/cache/cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ type Options struct {
109109
// So that all informers will not send list requests simultaneously.
110110
Resync *time.Duration
111111

112-
// KeyFunction is the cache.KeyFunc that the informers will be configured to use.
113-
// Defaults to cache.MetaNamespaceKeyFunc from client-go
112+
// NewInformerFunc is a function that is used to create SharedIndexInformers.
113+
// Defaults to cache.NewSharedIndexInformer from client-go
114114
NewInformerFunc client.NewInformerFunc
115115

116116
// Indexers is the indexers that the informers will be configured to use.

pkg/cache/internal/cache_reader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import (
3636
"sigs.k8s.io/controller-runtime/pkg/client"
3737
)
3838

39+
// TODO(KCP) need to implement and plumb through our own cache reader
40+
3941
// CacheReader is a client.Reader.
4042
var _ client.Reader = &CacheReader{}
4143

pkg/client/interfaces.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type Patch interface {
4444
Data(obj Object) ([]byte, error)
4545
}
4646

47+
// NewInformerFunc describes a function that creates SharedIndexInformers.
48+
// Its signature matches cache.NewSharedIndexInformer from client-go
4749
type NewInformerFunc func(cache.ListerWatcher, runtime.Object, time.Duration, cache.Indexers) cache.SharedIndexInformer
4850

4951
// TODO(directxman12): is there a sane way to deal with get/delete options?

pkg/handler/enqueue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func (e *EnqueueRequestForObject) Generic(evt event.GenericEvent, q workqueue.Ra
7777

7878
func request(obj client.Object) reconcile.Request {
7979
return reconcile.Request{
80+
// TODO(kcp) Need to implement a non-kcp-specific way to support this
8081
ClusterName: logicalcluster.From(obj).String(),
8182
ObjectKey: client.ObjectKey{
8283
Namespace: obj.GetNamespace(),

pkg/reconcile/reconcile.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ type Request struct {
4848
// ObjectKey is the name, namespace, and cluster of the object to reconcile.
4949
client.ObjectKey
5050

51+
// ClusterName can be used for reconciling requests across multiple clusters,
52+
// to prevent objects with the same name and namespace from conflicting
5153
ClusterName string
5254
}
5355

0 commit comments

Comments
 (0)