Skip to content

Commit bd5cf98

Browse files
committed
address comments
1 parent 3af141f commit bd5cf98

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

cmd/lk/agent.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error {
830830
agentDeployment := ""
831831
if cmd.IsSet("deployment") {
832832
agentDeployment = cmd.String("deployment")
833-
fmt.Printf("Using deployment [%s]\n", util.Accented(agentDeployment))
833+
out.Statusf("Using deployment [%s]", util.Accented(agentDeployment))
834834
}
835835

836836
excludeFiles := []string{fmt.Sprintf("**/%s", config.LiveKitTOMLFile)}
@@ -1344,7 +1344,7 @@ func listAgentSecrets(ctx context.Context, cmd *cli.Command) error {
13441344
if slices.Contains(ignoredSecrets, secret.Name) {
13451345
continue
13461346
}
1347-
table.Row(secret.Name, secret.CreatedAt.AsTime().Format(time.RFC3339), secret.UpdatedAt.AsTime().Format(time.RFC3339))
1347+
table.Row(secret.Name, formatTime(secret.CreatedAt.AsTime()), formatTime(secret.UpdatedAt.AsTime()))
13481348
}
13491349

13501350
out.Result(table)
@@ -1463,7 +1463,7 @@ func selectAgent(ctx context.Context, cmd *cli.Command, excludeEmptyVersion bool
14631463
if deployedAt := agent.DeployedAt.AsTime(); deployedAt.IsZero() {
14641464
deployedStr = "never deployed"
14651465
} else {
1466-
deployedStr = "deployed " + deployedAt.Format(time.RFC3339)
1466+
deployedStr = "deployed " + formatTime(deployedAt)
14671467
}
14681468
name := agent.AgentId + " " + util.Dimmed(deployedStr)
14691469
agentNames = append(agentNames, huh.Option[string]{Key: name, Value: agent.AgentId})
@@ -1776,10 +1776,3 @@ func generateAgentDockerfile(ctx context.Context, cmd *cli.Command) error {
17761776

17771777
return nil
17781778
}
1779-
1780-
func formatTime(t time.Time) string {
1781-
if t.IsZero() {
1782-
return "---"
1783-
}
1784-
return t.Format(time.RFC3339)
1785-
}

cmd/lk/token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,9 @@ func createToken(ctx context.Context, c *cli.Command) error {
481481
return err
482482
}
483483
case string(util.OpenTargetConsole):
484-
// TODO (steveyoon): pass deployment to console when supported
485484
if err := util.OpenInConsole(dashboardURL, project.ProjectId, &util.ConsoleURLParams{
486485
AgentName: agent,
486+
Deployment: agentDeployment,
487487
JobMetadata: jobMetadata,
488488
Identity: participant,
489489
RoomName: room,

cmd/lk/utils.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"maps"
2121
"os"
2222
"strings"
23+
"time"
2324

2425
"github.com/joho/godotenv"
2526
"github.com/mattn/go-isatty"
@@ -474,3 +475,10 @@ func (s *templateStringValue) String() string {
474475
}
475476
return ""
476477
}
478+
479+
func formatTime(t time.Time) string {
480+
if t.IsZero() {
481+
return "---"
482+
}
483+
return t.Format(time.RFC3339)
484+
}

pkg/util/open.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func OpenInMeet(livekitURL, token string) error {
7676

7777
type ConsoleURLParams struct {
7878
AgentName string `url:"agentName,omitempty"`
79+
Deployment string `url:"deployment,omitempty"`
7980
JobMetadata string `url:"jobMetadata,omitempty"`
8081
RoomName string `url:"roomName,omitempty"`
8182
RoomMetadata string `url:"roomMetadata,omitempty"`

0 commit comments

Comments
 (0)