Skip to content

Commit

Permalink
Fix backward compatibility glitch in telepresence version command.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Hallgren <[email protected]>
  • Loading branch information
thallgren committed Jan 31, 2024
1 parent 030848a commit 5b6c521
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/client/cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ func addDaemonVersions(ctx context.Context, kvf *ioutil.KeyValueFormatter) {
switch {
case err == nil:
kvf.Add(vi.Name, vi.Version)
if af, err := trafficAgentFQN(ctx); err == nil {
af, err := trafficAgentFQN(ctx)
switch status.Code(err) {
case codes.OK:
kvf.Add("Traffic Agent", af.FQN)
} else if status.Code(err) != codes.Unavailable {
case codes.Unimplemented:
kvf.Add("Traffic Agent", "not reported by traffic-manager")
case codes.Unavailable:
kvf.Add("Traffic Agent", "not currently available")
default:
kvf.Add("Traffic Agent", fmt.Sprintf("error: %v", err))
}
case status.Code(err) == codes.Unavailable:
Expand Down

0 comments on commit 5b6c521

Please sign in to comment.