# Why can the deployment be updated successfully after the ResourceVersion is set to ""?

**URL:** <https://discuss.kubernetes.io/t/why-can-the-deployment-be-updated-successfully-after-the-resourceversion-is-set-to/30645>\
**Category:** General Discussions\
**Tags:** development, apiserver\
**Created:** [November 27, 2024, 7:30am UTC](https://discuss.kubernetes.io/t/why-can-the-deployment-be-updated-successfully-after-the-resourceversion-is-set-to/30645 "2024-11-27T07:30:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangyizhi1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/wangyizhi1/32/16347_2.png) [@wangyizhi1](https://discuss.kubernetes.io/u/wangyizhi1)\
**Post date:** [November 27, 2024, 7:30am UTC](https://discuss.kubernetes.io/t/why-can-the-deployment-be-updated-successfully-after-the-resourceversion-is-set-to/30645/1 "2024-11-27T07:30:53Z")

</div>

### Cluster information:

Kubernetes version: v1.25.7

### example

```golang
package main

import (
	"context"
	"fmt"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/tools/clientcmd"
)

func main() {
	config, err := clientcmd.BuildConfigFromFlags("", "path_to_kubeconfig")
	if err != nil {
		panic(err.Error())
	}

	clientset, err := kubernetes.NewForConfig(config)
	if err != nil {
		panic(err.Error())
	}

	aiClient, err := aiclient.NewForConfig(config)
	if err != nil {
		panic(err.Error())
	}

	deploymentsClient := clientset.AppsV1().Deployments("kube-system")
	deployment, err := deploymentsClient.Get(context.TODO(), "coredns", metav1.GetOptions{})
	if err != nil {
		panic(err.Error())
	}

	deployment.ResourceVersion = ""
	replicas := int32(3)
	deployment.Spec.Replicas = &replicas

	_, err = deploymentsClient.Update(context.TODO(), deployment, metav1.UpdateOptions{})
	if err != nil {
		panic(err.Error())
	}
}

```

Why can the deployment be updated successfully after the ResourceVersion is set to “”? but the custom resource cannot?

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [November 27, 2024, 4:59pm UTC](https://discuss.kubernetes.io/t/why-can-the-deployment-be-updated-successfully-after-the-resourceversion-is-set-to/30645/2 "2024-11-27T16:59:09Z")

</div>

Clearing RV explicitly means “do not do conflict detection”. If someone else wrote to that object between the time you read it and the time you wrote it, your change will destroy theirs.
