tailscale/cmd/k8s-operator
Maisem Ali c919ff540f cmd/k8s-operator,ipn/store/kubestore: patch secrets instead of updating
We would call Update on the secret, but that was racey and would occasionaly
fail. Instead use patch whenever we can.

Fixes errors like
```
boot: 2023/08/29 01:03:53 failed to set serve config: sending serve config: updating config: writing ServeConfig to StateStore: Operation cannot be fulfilled on secrets "ts-webdav-kfrzv-0": the object has been modified; please apply your changes to the latest version and try again

{"level":"error","ts":"2023-08-29T01:03:48Z","msg":"Reconciler error","controller":"ingress","controllerGroup":"networking.k8s.io","controllerKind":"Ingress","Ingress":{"name":"webdav","namespace":"default"},"namespace":"default","name":"webdav","reconcileID":"96f5cfed-7782-4834-9b75-b0950fd563ed","error":"failed to provision: failed to create or get API key secret: Operation cannot be fulfilled on secrets \"ts-webdav-kfrzv-0\": the object has been modified; please apply your changes to the latest version and try again","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:324\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:265\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.15.0/pkg/internal/controller/controller.go:226"}
```

Updates #502
Updates #7895

Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-08-29 13:24:05 -07:00
..
manifests cmd/k8s-operator: update RBAC to allow creating events 2023-08-28 13:15:04 -07:00
ingress.go cmd/k8s-operator: put Tailscale IPs in Service ingress status 2023-08-28 09:07:18 -07:00
operator_test.go cmd/k8s-operator: add matching family addresses to status 2023-08-28 13:41:17 -07:00
operator.go cmd/k8s-operator: support being the default loadbalancer controller 2023-08-28 08:43:46 -07:00
proxy_test.go all: adjust some build tags for plan9 2023-08-24 15:42:35 -07:00
proxy.go all: adjust some build tags for plan9 2023-08-24 15:42:35 -07:00
sts.go cmd/k8s-operator,ipn/store/kubestore: patch secrets instead of updating 2023-08-29 13:24:05 -07:00
svc.go cmd/k8s-operator: add matching family addresses to status 2023-08-28 13:41:17 -07:00