kubernetes – When kubectl replace might recreate resource?

A source file of gitops-engine (an engine used in ArgoCD) contains the following comment:

Avoid using kubectl replace for CRDs since ‘replace’ might recreate resource and so delete all CRD instances.
The same thing applies for namespaces, which would delete the namespace as well as everything within it,
so we want to avoid using kubectl replace in that case as well.

(source github.com/argoproj/gitops-engine/blob/e56739ceba00848d6e8a6ba8eb935ca3b5c800dc/pkg/sync/sync_context.go#L918-L920)

In what situations the recreation might happen? (Without using the --force flag.)

Read more here: Source link