Then the notification-controller enter in an infinite reconciliation loop.
apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Receiver
metadata:
name: foo
spec:
type: generic
secretRef:
name: foo-token
resources:
- kind: GitRepository
name: bar
[...]
{"level":"info","ts":"2021-02-05T14:15:28.883Z","logger":"controller.receiver","msg":"Receiver initialised","reconciler group":"notification.toolkit.fluxcd.io","reconciler kind":"Receiver","name":"foo","namespace":"flux-system"}
{"level":"error","ts":"2021-02-05T14:15:28.890Z","logger":"controller.receiver","msg":"Reconciler error","reconciler group":"notification.toolkit.fluxcd.io","reconciler kind":"Receiver","name":"foo","namespace":"flux-system","error":"Operation cannot be fulfilled on receivers.notification.toolkit.fluxcd.io \"foo\": the object has been modified; please apply your changes to the latest version and try again"}
{"level":"info","ts":"2021-02-05T14:15:28.907Z","logger":"controller.receiver","msg":"Receiver initialised","reconciler group":"notification.toolkit.fluxcd.io","reconciler kind":"Receiver","name":"foo","namespace":"flux-system"}
{"level":"error","ts":"2021-02-05T14:15:28.913Z","logger":"controller.receiver","msg":"Reconciler error","reconciler group":"notification.toolkit.fluxcd.io","reconciler kind":"Receiver","name":"foo","namespace":"flux-system","error":"Operation cannot be fulfilled on receivers.notification.toolkit.fluxcd.io \"foo\": the object has been modified; please apply your changes to the latest version and try again"}
[...]
{"level":"error","ts":"2021-02-05T14:15:29.872Z","logger":"controller.receiver","msg":"Reconciler error","reconciler group":"notification.toolkit.fluxcd.io","reconciler kind":"Receiver","name":"foo","namespace":"flux-system","error":"Operation cannot be fulfilled on receivers.notification.toolkit.fluxcd.io \"foo\": StorageError: invalid object, Code: 4, Key: /registry/notification.toolkit.fluxcd.io/receivers/flux-system/foo, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: d99a981f-6d66-4403-8ff9-442354ab1de0, UID in object meta: "}
[...]
# kubectl get receivers -w
[...]
foo False unable to read token from secret 'flux-system/foo-token' error: Secret "foo-token" not found 1s
foo True Receiver initialised with URL: /hook/3066a8efff25c5e29792e8a96ee867f9f98533af0d8a6dc6ed9636ee1b5f3a5b 1s
foo False unable to read token from secret 'flux-system/foo-token' error: Secret "foo-token" not found 1s
foo True Receiver initialised with URL: /hook/3066a8efff25c5e29792e8a96ee867f9f98533af0d8a6dc6ed9636ee1b5f3a5b 1s
foo False unable to read token from secret 'flux-system/foo-token' error: Secret "foo-token" not found 1s
foo True Receiver initialised with URL: /hook/3066a8efff25c5e29792e8a96ee867f9f98533af0d8a6dc6ed9636ee1b5f3a5b 1s
foo True Receiver initialised with URL: /hook/3066a8efff25c5e29792e8a96ee867f9f98533af0d8a6dc6ed9636ee1b5f3a5b 1s
[...]