odo: odo push trigger redeploy even if there are no changes in devfile
/kind bug /area devfile /priority medium
If there are no changes to Devfile.yaml that would resolve in changes in Deploment the Deployment should not be triggered.
Current behaviour
export ODO_EXPERIMENTAL=true
# running push for the first time
▶ odo push ; kubectl get pods
• Push devfile component odo-examples ...
✓ Waiting for component to start [9s]
✓ Push devfile component odo-examples [10s]
NAME READY STATUS RESTARTS AGE
odo-examples-8cb546c7b-sbmxd 1/1 Running 0 11s
# just triggering push again without any changes
▶ odo push ; kubectl get pods
• Push devfile component odo-examples ...
✓ Waiting for component to start [174ms]
✓ Push devfile component odo-examples [1s]
NAME READY STATUS RESTARTS AGE
odo-examples-8cb546c7b-sbmxd 1/1 Terminating 0 71s
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (12 by maintainers)
Commits related to this issue
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
- Fix bug that triggers redeploy even if there are no changes in the file **What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply... — committed to cdrage/odo by cdrage 4 years ago
@yangcao77 That’s correct, I was able to see the order of the volumes in the pod spec change sometimes and that causes the redeploy to occur. Another way to check that it’s happening is to run
kubectl get rs -w
to watch for any ReplicaSet changes. If a redeploy occurs you will see new events during the push.@cdrage @kadel Since I was the only one who was able to reproduce it, I investigated a bit further and found the problem and have a fix I’ll submit a PR for. The problem was related to iterating over maps in a couple places and iteration order of maps is not guaranteed so I changed it to use splices of structs instead. Here are the changes for anyone that’s interested: https://github.com/maysunfaisal/odo-fork/compare/2654-1...rajivnathan:2654-1?expand=1
With this change I can no longer reproduce. Since this is a relatively minor problem I’ll put up a PR after https://github.com/openshift/odo/pull/2735 is merged.