diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index b09bc330..e91875e7 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -628,6 +628,11 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { return err } + attrs, err := resolveDeployAttributes(ctx, cmd) + if err != nil { + return err + } + imageRef := cmd.String("image") imageTar := cmd.String("image-tar") // Prebuilt image: no local project layout is required; skip language/dockerfile/sdk checks. @@ -651,10 +656,6 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { return err } out.Statusf("Created agent with ID [%s]", util.Accented(agentID)) - attrs, err := resolveDeployAttributes(buildContext, cmd) - if err != nil { - return err - } return deployPrebuiltImage(buildContext, agentID, imageRef, imageTar, attrs) } @@ -686,7 +687,7 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { regions := []string{region} excludeFiles := []string{fmt.Sprintf("**/%s", config.LiveKitTOMLFile)} - resp, err := agentsClient.CreateAgent(buildContext, os.DirFS(workingDir), secrets, regions, excludeFiles, os.Stderr) + resp, err := agentsClient.CreateAgent(buildContext, os.DirFS(workingDir), secrets, regions, attrs, excludeFiles, os.Stderr) if err != nil { if errors.Is(err, context.DeadlineExceeded) { return fmt.Errorf("build timed out possibly due to large image size") diff --git a/go.mod b/go.mod index 8ca80871..8cb47f7d 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/joho/godotenv v1.5.1 github.com/klauspost/compress v1.19.1 github.com/livekit/protocol v1.50.5-0.20260824151414-2122e1d08bc9 - github.com/livekit/server-sdk-go/v2 v2.18.2-0.20260824093707-96a978c6d455 + github.com/livekit/server-sdk-go/v2 v2.18.2-0.20260824201634-1f82cc396645 github.com/mattn/go-isatty v0.0.22 github.com/moby/moby/client v0.4.1 github.com/moby/patternmatcher v0.6.1 diff --git a/go.sum b/go.sum index 004d89cf..e49ddf5b 100644 --- a/go.sum +++ b/go.sum @@ -348,8 +348,8 @@ github.com/livekit/protocol v1.50.5-0.20260824151414-2122e1d08bc9 h1:miNG55TBZC+ github.com/livekit/protocol v1.50.5-0.20260824151414-2122e1d08bc9/go.mod h1:h4wP4IBPkT5aew7SZSGViHSmanKAiKWsHij/5YfL4BE= github.com/livekit/psrpc v0.7.3 h1:bekuZt/ZQzg8+/M8G6G5jq7bvV9fAKdPHSOZeTwrIIc= github.com/livekit/psrpc v0.7.3/go.mod h1:rAI+m2+/cb4x9RXhLRtUx5ZwdfjjXOl4zi46IjEetaw= -github.com/livekit/server-sdk-go/v2 v2.18.2-0.20260824093707-96a978c6d455 h1:VwmCRY/b6f4gWtJyCJejqWnBlUYeHb6MTh4LznGF6Q0= -github.com/livekit/server-sdk-go/v2 v2.18.2-0.20260824093707-96a978c6d455/go.mod h1:qkHEZCUjVLpBs2zIhDo7zbX5f1mehGAROkRkPNSyfpc= +github.com/livekit/server-sdk-go/v2 v2.18.2-0.20260824201634-1f82cc396645 h1:KGS5da8KCS1sg3PwNUaZMYB2gjn8HJVji8alF9UU7Ys= +github.com/livekit/server-sdk-go/v2 v2.18.2-0.20260824201634-1f82cc396645/go.mod h1:qkHEZCUjVLpBs2zIhDo7zbX5f1mehGAROkRkPNSyfpc= github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/magefile/mage v1.17.2 h1:fyXVu1eadI8Ap1HCCNgEhJ5McIWiYhLR8uol64ZZc40=