Skip to content
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
4 changes: 2 additions & 2 deletions lib/teleterm/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,12 +875,12 @@ func (s *Service) AssumeRole(ctx context.Context, req *api.AssumeRoleRequest) er
defer s.gatewaysMu.RUnlock()
for _, gw := range s.gateways {
targetURI := gw.TargetURI()
if !targetURI.IsKube() && targetURI.GetRootClusterURI() != cluster.URI {
if !targetURI.IsKube() || targetURI.GetRootClusterURI() != cluster.URI {
continue
}
kubeGw, err := gateway.AsKube(gw)
if err != nil {
s.cfg.Logger.ErrorContext(ctx, "Could not clear certs for kube when assuming request", "error", err, "target_uri", targetURI)
return trace.Wrap(err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the semantics here though?

Copy link
Copy Markdown
Contributor Author

@gzdunek gzdunek Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We forgot to stop execution if the error is not nil, instead we log and still call the method which causes panic.
  2. If this error happens, it's not really a problem with clearing certs, but rather with converting one type to another which should not happen. It means a more serious issue, so I think we should surface it to the user.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that makes total sense.

}
kubeGw.ClearCerts()
}
Expand Down
Loading