Skip to content

Commit 01a3854

Browse files
committed
fix log call when agent doesn't exist
1 parent 9e5a25c commit 01a3854

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/lk/agent.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ func getLogs(ctx context.Context, cmd *cli.Command) error {
784784
return err
785785
}
786786

787+
if len(response.Agents) == 0 {
788+
return fmt.Errorf("no agent deployments found")
789+
}
790+
787791
err = agentfs.LogHelper(ctx, agentID, cmd.String("log-type"), project, response.Agents[0].AgentDeployments[0].ServerRegion)
788792
return err
789793
}

0 commit comments

Comments
 (0)