mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
cleanup: clarify correlatedOldValueForChildAtNewIndex comment
This commit is contained in:
parent
e1fa1df3ae
commit
abb68591af
@ -68,11 +68,14 @@ func NewCorrelatedObject(new, old interface{}, schema Schema) *CorrelatedObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If oldValue is not a list, returns nil
|
// If oldValue is not a list, returns nil
|
||||||
// If oldValue is a list takes mapType into account and attempts to find the
|
// If oldValue is a list, this function takes mapType into account and attempts
|
||||||
// old value with the same index or key, depending upon the mapType.
|
// to find the old value with the same index or key
|
||||||
//
|
//
|
||||||
// If listType is map, creates a map representation of the list using the designated
|
// If listType is map, creates a map representation of the list using the designated
|
||||||
// map-keys and caches it for future calls.
|
// map-keys, caches it for future calls, and returns the map value, or nil if
|
||||||
|
// the correlated key is not in the old map
|
||||||
|
//
|
||||||
|
// If the list type is not correlatable this funcion returns nil.
|
||||||
func (r *CorrelatedObject) correlateOldValueForChildAtNewIndex(index int) interface{} {
|
func (r *CorrelatedObject) correlateOldValueForChildAtNewIndex(index int) interface{} {
|
||||||
oldAsList, ok := r.OldValue.([]interface{})
|
oldAsList, ok := r.OldValue.([]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user