omrikiei / ktunnel

A cli that exposes your local resources to kubernetes
GNU General Public License v3.0
975 stars 75 forks source link

Fix error handling for ProgressDeadlineExceeded #52

Closed sjones512 closed 3 years ago

sjones512 commented 3 years ago

HI @omrikiei,

The primary reason for this change is to fix a bug detecting ProgressDeadlineExceeded. I was accidentally checking for that in the Type when it should have been in the Reason.

While I was testing it out (Deployments failing because the v1.3.8 image doesn't exist yet), I noticed some inconsistent behavior that led to a bit of refactoring.

It appears that if you have maxUnavailable: 1 in your Deployment yaml, it can cause issues where ProgressDeadlineExceeded is never raised. I added a warning to notify since it is something that can be handled in the yaml.

The other change was getting the most recent update time from the ManagedFields. This might have been what we were looking for all along with the original waitForReady method, but I didn't investigate to thoroughly. Before adding it the rollback would sometimes exit with the ProgressDeadlineExceeded error still in the status from the previous failed deployment.

Let me know what you think. Sorry to complicate things.