          (get-in [:state :terminated])
          (nil?))))
 
+(defn- drop-managed-fields
+  "Removes the :metadata :managedFields entry from a k8s object."
+  [k8s-obj]
+  (utils/dissoc-in k8s-obj [:metadata :managedFields]))
+
 (defn streaming-api-request
   "Make a long-lived HTTP request to the Kubernetes API server using the configured authentication.
    If data is provided via :body, the application/json content type is added automatically.

                              :accept "application/json"
                              (cond-> options
                                auth-str (assoc-in [:headers "Authorization"] auth-str)
                                (and (not content-type) body) (assoc :content-type "application/json"))))]
      (scheduler/log "response from K8s API server:" result)
      result)
    (catch [:status http-400-bad-request] response

                          (when namespace (str "/namespaces/" namespace))
                          "/pods?labelSelector=waiter%2Fcluster=" cluster-name)
       :metadata-key :pods-metadata
       :update-fn (fn pods-watch-update [{raw-pod :object update-type :type}]
                    (let [now (t/now)
                          ;; Drop managedFields from response objects when present (much too verbose!)
                          ;; https://github.com/kubernetes/kubernetes/issues/90066
                          pod (drop-managed-fields raw-pod)
                          pod-id (k8s-object->id pod)
                          service-id (k8s-object->service-id pod)
                          version (k8s-object->resource-version pod)
