patch-operator icon indicating copy to clipboard operation
patch-operator copied to clipboard

Non idempotent patch causing infinite reconciliation

Open andreadecorte opened this issue 2 years ago • 13 comments

I faced an issue with a patch which appends items to an array.

[
    {
        "op": "add",
        "path": "/spec/install/spec/deployments/0/spec/template/spec/containers/0/args/-",
        "value": "--dns01-recursive-nameservers-only"
    },
    {
        "op": "add",
        "path": "/spec/install/spec/deployments/0/spec/template/spec/containers/0/args/-",
        "value": "--dns01-recursive-nameservers=8.8.8.8:53,1.1.1.1:53"
    }
]

This patch is not idempotent and the issue is that patch operator tries to apply continuously until your etcd will eat up all the available memory. I think this behaviour is expected with this kind of patches, but I still think it would be good to have a safety mechanism to avoid this since it can have really bad consequences.

andreadecorte avatar Jun 20 '22 21:06 andreadecorte