<p>I'm using <a href="https://metacontroller.app" rel="nofollow noreferrer">Metacontroller</a> to implement a Kubernetes operator. </p>

<p>My problem is the following:</p>

<ol>
<li>Metacontroller never stops calling my sync hook for my controller ( <a href="https://metacontroller.app/api/compositecontroller/" rel="nofollow noreferrer">composite controllers</a> in that case), and </li>
<li>the parent resources <code>status.observedGeneration</code> field is getting updated continuously (from what I understand that means the resource was recreated).</li>
</ol>

<p>The composite controller documentation (specifically the <a href="https://metacontroller.app/api/compositecontroller/#sync-hook-response" rel="nofollow noreferrer">response documentation</a>) suggests that if there are no changes in the returned parent status or in the children collection, Metacontroller should stop calling the sync hook. </p>

<p>I additionally removed <code>spec.resyncPeriodSeconds</code> and <code>spec.parentResource.revisionHistory</code> from the composite controller manifest (to not trigger any calls to the sync hook due to timer events or changes to the parent's <code>status</code> field) .</p>

<p>Sadly, none of this worked. How can I tell Metacontroller to stop calling the sync hook and stop to create the resource?</p>

FK82
<p>You probably need to enable the "status" subresource for your CRD: <a href="https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#status-subresource" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#status-subresource</a></p>

<pre><code>apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: myresource
spec:
...
  subresources:
    status: {}
</code></pre>

<p>Without that, Metacontroller will treat status updates as normal resource updates which in turn creates a new <code>.metadata.resourceVersion</code> / <code>.metadata.generation</code> because Metacontroller always adds an updated <code>.status.observedGeneration</code> field. </p>

<p>See here: <a href="https://github.com/GoogleCloudPlatform/metacontroller/blob/985572b9052a306f7e4d4fb84f2ced6f74247dd5/dynamic/clientset/clientset.go#L200" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/metacontroller/blob/985572b9052a306f7e4d4fb84f2ced6f74247dd5/dynamic/clientset/clientset.go#L200</a></p>

<p>I have created an issue for this: <a href="https://github.com/GoogleCloudPlatform/metacontroller/issues/176" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/metacontroller/issues/176</a></p>

<p>Hopefully this will make this situation more obvious in the future.</p>
