MCPcopy
hub / github.com/apecloud/kubeblocks / IsObjectUpdating

Function IsObjectUpdating

pkg/controller/model/transform_utils.go:137–158  ·  view source on GitHub ↗
(object client.Object)

Source from the content-addressed store, hash-verified

135}
136
137func IsObjectUpdating(object client.Object) bool {
138 value := reflect.ValueOf(object)
139 if value.Kind() == reflect.Ptr {
140 value = value.Elem()
141 }
142 if value.Kind() != reflect.Struct {
143 return false
144 }
145 status := value.FieldByName("Status")
146 if !status.IsValid() {
147 return false
148 }
149 observedGeneration := status.FieldByName("ObservedGeneration")
150 if !observedGeneration.IsValid() {
151 return false
152 }
153 generation := value.FieldByName("Generation")
154 if !generation.IsValid() {
155 return false
156 }
157 return observedGeneration.Interface() != generation.Interface()
158}
159
160func IsObjectStatusUpdating(object client.Object) bool {
161 return !IsObjectDeleting(object) && !IsObjectUpdating(object)

Callers 5

TransformMethod · 0.92
notifyMethod · 0.92
PreConditionMethod · 0.92
IsObjectStatusUpdatingFunction · 0.85

Calls 1

KindMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…