kapp deploy mutates created/updated resources twice causing conflicts
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
**What steps did you take:**
Create a deployment yaml
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 0
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
```
In another terminal watch deployments
```
kubectl get deployment -w -oyaml
```
**What happened:**
After the deployment is applied kapp immediately updates it - you can see `generation: 2`.
Looking at my k8s service API logs it causes `Conflicts` on creating and updating resources
This is causing to fail deploying at times
```
kapp: Error: Applying update deployment/activator (apps/v1) namespace: 24f0bc17-06dc-424b-a9db-8d4e744d7790:
Failed to update due to resource conflict (approved diff no longer matches):
Updating resource deployment/activator (apps/v1) namespace: 24f0bc17-06dc-424b-a9db-8d4e744d7790:
API server says:
Operation cannot be fulfilled on deployments.apps "activator": the object has been modified; please apply your changes to the latest version and try again (reason: Conflict)
```
**What did you expect:**
`kapp` doesn't mutate resources after they are created/updated
**Anything else you would like to add:**
[Additional information that will assist in solving the issue.]
**Environment:**
- kapp version (use `kapp --version`): v0.46.0
- OS (e.g. from `/etc/os-release`): Mac OS X/Linux
- Kubernetes version (use `kubectl version`) - K8s 1.21/1.22
---
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
Contributor guide
Assessment
This issue has not been assessed yet.