Fixes formatting and typos in client-go docs

Kubernetes-commit: d0de4483d51c5811202f1731a835c75d8fc8b30e
This commit is contained in:
kfu 2021-04-27 21:28:23 +02:00 committed by Kubernetes Publisher
parent c850435001
commit 6db26dd413
2 changed files with 7 additions and 7 deletions

View File

@ -325,7 +325,7 @@ func NewInformer(
return clientState, newInformer(lw, objType, resyncPeriod, h, clientState) return clientState, newInformer(lw, objType, resyncPeriod, h, clientState)
} }
// NewIndexerInformer returns a Indexer and a controller for populating the index // NewIndexerInformer returns an Indexer and a Controller for populating the index
// while also providing event notifications. You should only used the returned // while also providing event notifications. You should only used the returned
// Index for Get/List operations; Add/Modify/Deletes will cause the event // Index for Get/List operations; Add/Modify/Deletes will cause the event
// notifications to be faulty. // notifications to be faulty.

View File

@ -153,7 +153,7 @@ const (
// change happened, and the object's state after* that change. // change happened, and the object's state after* that change.
// //
// [*] Unless the change is a deletion, and then you'll get the final // [*] Unless the change is a deletion, and then you'll get the final
// state of the object before it was deleted. // state of the object before it was deleted.
type Delta struct { type Delta struct {
Type DeltaType Type DeltaType
Object interface{} Object interface{}
@ -174,9 +174,10 @@ type Deltas []Delta
// modifications. // modifications.
// //
// TODO: consider merging keyLister with this object, tracking a list of // TODO: consider merging keyLister with this object, tracking a list of
// "known" keys when Pop() is called. Have to think about how that // "known" keys when Pop() is called. Have to think about how that
// affects error retrying. // affects error retrying.
// NOTE: It is possible to misuse this and cause a race when using an //
// NOTE: It is possible to misuse this and cause a race when using an
// external known object source. // external known object source.
// Whether there is a potential race depends on how the consumer // Whether there is a potential race depends on how the consumer
// modifies knownObjects. In Pop(), process function is called under // modifies knownObjects. In Pop(), process function is called under
@ -185,8 +186,7 @@ type Deltas []Delta
// //
// Example: // Example:
// In case of sharedIndexInformer being a consumer // In case of sharedIndexInformer being a consumer
// (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/ // (https://github.com/kubernetes/kubernetes/blob/0cdd940f/staging/src/k8s.io/client-go/tools/cache/shared_informer.go#L192),
// src/k8s.io/client-go/tools/cache/shared_informer.go#L192),
// there is no race as knownObjects (s.indexer) is modified safely // there is no race as knownObjects (s.indexer) is modified safely
// under DeltaFIFO's lock. The only exceptions are GetStore() and // under DeltaFIFO's lock. The only exceptions are GetStore() and
// GetIndexer() methods, which expose ways to modify the underlying // GetIndexer() methods, which expose ways to modify the underlying