Skip to content

bug: resourceVersion should not be set on objects to be created

Rafe was seeing errors in the logs along the lines of the following when testing cron job MR:

{
"severity":"INFO",
"timestamp":"2025-06-06T22:23:00.140420203Z",
"logger":"civicrm-controller.event-broadcaster",
"caller":"record/event.go:377",
"message":"Event(v1.ObjectReference{Kind:\"CiviInstance\", Namespace:\"default\", Name:\"civipress\", UID:\"0465dc8d-b1c0-44b2-89a3-30d2c718bf40\", APIVersion:\"operator.civicrm.org/v1alpha1\", ResourceVersion:\"1048\", FieldPath:\"\"}): type: 'Warning' reason: 'InternalError' resourceVersion should not be set on objects to be created",
"commit":"ee91609-dirty"
}

The ResourceVersion:"1048" arg is problematic, and needs to be found and removed from calls to create.