omrikiei / ktunnel

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

Issue waiting for pod to be ready after injecting #47

Closed sjones512 closed 3 years ago

sjones512 commented 3 years ago

I believe there is an issue waiting for the newly injected pod to be ready.

injector.go:28 waitForReady(&o.Name, o.GetCreationTimestamp().Time, *o.Spec.Replicas, readyChan)

This line seems to always use the creation timestamp of the deployment which is not updated when the deployment is modified. I think we're on Kubernetes 1.19.

Perhaps I'm misunderstanding the code but don't we want a pod created after the the current time in this scenario?

Issue seems to manifest for me as sometimes having to run the inject command 2x. The first time in updates the deployment and then tries to connect to the pod that existed before the deployment was changed.

The second time it detects the sidecar and creates the tunnel successfully.

Thanks.

omrikiei commented 3 years ago

tested and merged, thank you again @sjones512