(object client.Object)
| 135 | } |
| 136 | |
| 137 | func 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 | |
| 160 | func IsObjectStatusUpdating(object client.Object) bool { |
| 161 | return !IsObjectDeleting(object) && !IsObjectUpdating(object) |
no test coverage detected
searching dependent graphs…