From 0495616230a13dcc19c9da8ec7b8b2a38e2b6a33 Mon Sep 17 00:00:00 2001 From: Alexander Zielenski Date: Fri, 13 Oct 2023 13:50:19 -0700 Subject: [PATCH] cleanup: add godoc --- staging/src/k8s.io/apiserver/pkg/cel/common/equality.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/staging/src/k8s.io/apiserver/pkg/cel/common/equality.go b/staging/src/k8s.io/apiserver/pkg/cel/common/equality.go index 10b03d01e1a..dd47341b597 100644 --- a/staging/src/k8s.io/apiserver/pkg/cel/common/equality.go +++ b/staging/src/k8s.io/apiserver/pkg/cel/common/equality.go @@ -20,6 +20,13 @@ import ( "reflect" ) +// CorrelatedObject represents a node in a tree of objects that are being +// validated. It is used to keep track of the old value of an object during +// traversal of the new value. It is also used to cache the results of +// DeepEqual comparisons between the old and new values of objects. +// +// CorrelatedObject is not thread-safe. It is the responsibility of the caller +// to handle concurrency, if any. type CorrelatedObject struct { // Currently correlated old value during traversal of the schema/object OldValue interface{} @@ -27,6 +34,8 @@ type CorrelatedObject struct { // Value being validated Value interface{} + // Schema used for validation of this value. The schema is also used + // to determine how to correlate the old object. Schema Schema // Scratch space below, may change during validation