Checklist:
argocd version.Describe the bug
Old ReplicaSet not deleted after rollout to new ReplicaSet (even when doing sync with prune enabled).
To Reproduce
Chart.yaml:
apiVersion: v1
name: test
description: A test app
type: application
version: 0.1.0
values.yaml:
replicaCount: 2
templates/deployment.yaml:
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
strategy:
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: nginx
image: nginx:alpine
ports:
- name: http
containerPort: 80
protocol: TCP
templates/service.yaml:
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
spec:
type: ClusterIP
ports:
- name: http
port: 8080
targetPort: 80
protocol: TCP
selector:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
Create and sync ArgoCD application from this chart.
Edit templates/deployment.yaml: and replace container image to nginx:latest. Sync with prune and wait till sync completes.
Observe the current state of the application: notice two replica sets instead of one.
Expected behavior
Old replica set is deleted after rollout complete.
Screenshots
Notice two replica sets, one is without any pods:

Version
argocd: v1.2.5+85f62df
BuildDate: 2019-10-29T00:05:49Z
GitCommit: 85f62dff9e3de5a2ee80e9350c897923f59b7e85
GitTreeState: clean
GoVersion: go1.12.6
Compiler: gc
Platform: linux/amd64
argocd-server: v1.2.4+ad7a69a
BuildDate: 2019-10-23T20:06:50Z
GitCommit: ad7a69a79883b7767cbeb88ca9a36d28277bd4ab
GitTreeState: clean
GoVersion: go1.12.6
Compiler: gc
Platform: linux/amd64
Ksonnet Version: 0.13.1
You should add revisionHistoryLimit to the deployment
Most helpful comment
You should add revisionHistoryLimit to the deployment