From d31f45f125444e8939cb9c17886fe77e27128faa Mon Sep 17 00:00:00 2001 From: Xudong Sun Date: Sat, 28 Sep 2024 11:26:03 -0500 Subject: [PATCH] Document unconditional update Signed-off-by: Xudong Sun --- .../kubernetes-model/unconditional_update.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 discussion/kubernetes-model/unconditional_update.md diff --git a/discussion/kubernetes-model/unconditional_update.md b/discussion/kubernetes-model/unconditional_update.md new file mode 100644 index 000000000..680bdd3ac --- /dev/null +++ b/discussion/kubernetes-model/unconditional_update.md @@ -0,0 +1,18 @@ +## Unconditional update + +### Description + +Many types of Kubernetes objects allow one to update the objects without providing a resource version, which is called [unconditional update](https://github.com/kubernetes/kubernetes/blob/v1.30.0/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go#L623-L631). During conditional update, API server will not perform resource version checking. + +Objects that allow unconditional update include: +- [ConfigMap](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/core/configmap/strategy.go#L96-L98) +- [Secret](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/core/secret/strategy.go#L100-L102) +- [Service](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/core/service/strategy.go#L112-L114) +- [Pod](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/core/pod/strategy.go#L161-L164) +- [ReplicaSet](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/apps/replicaset/strategy.go#L179-L181) +- [Deployment](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/apps/deployment/strategy.go#L167-L169) +- [DaemonSet](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/apps/daemonset/strategy.go#L183-L186) +- [StatefulSet](https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/registry/apps/statefulset/strategy.go#L189-L192) + +Objects that do not allow unconditional update include: +- [CustomResource](https://github.com/kubernetes/kubernetes/blob/v1.30.0/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/strategy.go#L271-L274)