Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set Kubernetes podname before broadcast attempts to access it #11286

Merged
merged 2 commits into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/kube/proxy/sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ func (s *session) launch() error {
}()

s.log.Debugf("Launching session: %v", s.id)
s.BroadcastMessage("Connecting to %v over K8S", s.podName)

q := s.req.URL.Query()
request := &remoteCommandRequest{
Expand All @@ -463,6 +462,9 @@ func (s *session) launch() error {
pingPeriod: s.forwarder.cfg.ConnPingPeriod,
}

s.podName = request.podName
s.BroadcastMessage("Connecting to %v over K8S", s.podName)

eventPodMeta := request.eventPodMeta(request.context, s.sess.creds)
s.io.OnWriteError = func(idString string, err error) {
s.mu.Lock()
Expand Down Expand Up @@ -541,7 +543,6 @@ func (s *session) launch() error {
}
}()

s.podName = request.podName
err = s.trackerUpdateState(types.SessionState_SessionStateRunning)
if err != nil {
s.log.Warn("Failed to set tracker state to running")
Expand Down