From 98154246edd286061e358c90077c6e38719cd4eb Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Wed, 15 Jul 2026 14:17:57 -0600 Subject: [PATCH 1/2] fix(agents): support attributes on BYOC deploys --- cmd/lk/agent.go | 14 ++++++++++---- go.mod | 10 ++++++---- go.sum | 18 ++++++++---------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/cmd/lk/agent.go b/cmd/lk/agent.go index 6c64f739..3aa83cd4 100644 --- a/cmd/lk/agent.go +++ b/cmd/lk/agent.go @@ -206,6 +206,8 @@ var ( skipSDKCheckFlag, agentPrebuiltImageFlag, agentPrebuiltImageTarFlag, + attributeFlag, + attributesFlag, }, // NOTE: since secrets may contain commas, or indeed any special character we might want to treat as a flag separator, // we disable it entirely here and require multiple --secrets flags to be used. @@ -644,7 +646,11 @@ func createAgent(ctx context.Context, cmd *cli.Command) error { return err } out.Statusf("Created agent with ID [%s]", util.Accented(agentID)) - return deployPrebuiltImage(buildContext, agentID, imageRef, imageTar) + attrs, err := resolveAttributes(cmd) + if err != nil { + return err + } + return deployPrebuiltImage(buildContext, agentID, imageRef, imageTar, attrs) } projectType, err := agentfs.DetectProjectType(os.DirFS(workingDir)) @@ -828,7 +834,7 @@ func deployAgent(ctx context.Context, cmd *cli.Command) error { return fmt.Errorf("failed to update agent secrets: %s", resp.Message) } } - if err := deployPrebuiltImage(buildContext, agentId, imageRef, imageTar); err != nil { + if err := deployPrebuiltImage(buildContext, agentId, imageRef, imageTar, attrs); err != nil { return fmt.Errorf("unable to deploy prebuilt image: %w", err) } out.Status("Deployed agent") @@ -893,7 +899,7 @@ func promoteAgent(ctx context.Context, cmd *cli.Command) error { // deployPrebuiltImage pushes a locally-built image through the cloud-agents OCI proxy. // Exactly one of imageRef (Docker daemon via the Docker API) or imageTar must be non-empty. -func deployPrebuiltImage(ctx context.Context, agentID, imageRef, imageTar string) error { +func deployPrebuiltImage(ctx context.Context, agentID, imageRef, imageTar string, attrs map[string]string) error { target, err := agentsClient.GetPushTarget(ctx, agentID) if err != nil { return fmt.Errorf("failed to get push target: %w", err) @@ -920,7 +926,7 @@ func deployPrebuiltImage(ctx context.Context, agentID, imageRef, imageTar string proxyRef := fmt.Sprintf("%s/%s:%s", target.ProxyHost, target.Name, target.Tag) out.Statusf("Pushing image [%s]", util.Accented(proxyRef)) - rt := agentsClient.NewRegistryTransport() + rt := agentsClient.NewRegistryTransport(attrs) if err := crane.Push(img, proxyRef, crane.WithTransport(rt), crane.WithAuth(authn.Anonymous), diff --git a/go.mod b/go.mod index 6f1fa5f2..2ed640a0 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/pion/rtcp v1.2.16 github.com/pion/rtp v1.10.2 - github.com/pion/webrtc/v4 v4.2.14 + github.com/pion/webrtc/v4 v4.2.15 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/stretchr/testify v1.11.1 github.com/twitchtv/twirp v8.1.3+incompatible @@ -193,11 +193,11 @@ require ( github.com/pion/mdns/v2 v2.1.0 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/sctp v1.10.0 // indirect - github.com/pion/sdp/v3 v3.0.18 // indirect + github.com/pion/sdp/v3 v3.0.19 // indirect github.com/pion/srtp/v3 v3.0.11 // indirect - github.com/pion/stun/v3 v3.1.4 // indirect + github.com/pion/stun/v3 v3.1.5 // indirect github.com/pion/transport/v4 v4.0.2 // indirect - github.com/pion/turn/v5 v5.0.8 // indirect + github.com/pion/turn/v5 v5.0.9 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -268,3 +268,5 @@ require ( // TEMP (local dev): use local protocol with the WorkerInfo dev message. // Drop once github.com/livekit/protocol publishes it. // replace github.com/livekit/protocol => ../protocol + +replace github.com/livekit/server-sdk-go/v2 => ../server-sdk-go diff --git a/go.sum b/go.sum index f387965b..62109edc 100644 --- a/go.sum +++ b/go.sum @@ -361,8 +361,6 @@ github.com/livekit/protocol v1.49.1-0.20260712215709-8847d7456816 h1:MDWDlH5dmcZ github.com/livekit/protocol v1.49.1-0.20260712215709-8847d7456816/go.mod h1:jO+y05AU9Ec4JswDyuzKCZ4bhziOS0CzMqgnbj60Dzs= github.com/livekit/psrpc v0.7.2 h1:6oZ+NODJ2pLyaT6VqDq1F4Qc/3TpDUSpyphj/P9MhQc= github.com/livekit/psrpc v0.7.2/go.mod h1:rAI+m2+/cb4x9RXhLRtUx5ZwdfjjXOl4zi46IjEetaw= -github.com/livekit/server-sdk-go/v2 v2.17.0 h1:FzVQMoxHv0WIg164yGqSxLeV+h3aJomjAv1lFeR9MMw= -github.com/livekit/server-sdk-go/v2 v2.17.0/go.mod h1:5nzTfVBH2Jz+TW1SrfpqC7wrbcD1lT94KZCJ9hOMyvk= 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= @@ -463,20 +461,20 @@ github.com/pion/rtp v1.10.2 h1:l+f6tTDcAH6xwepaAoW791ddhuYsJlqRATOzirO04Mo= github.com/pion/rtp v1.10.2/go.mod h1:Au8fc6cEByy8RLTwKTQTEeQqDB/SJDxwL4mZuxYA5Pk= github.com/pion/sctp v1.10.0 h1:qeoD6swF/2M5bYRcAGayqSbTKX3m4AW29CiQxG1+Pfg= github.com/pion/sctp v1.10.0/go.mod h1:N20Dq6LY+JvJDAh9VVh1JELngb2rQ8dPgds5yBWiPgw= -github.com/pion/sdp/v3 v3.0.18 h1:l0bAXazKHpepazVdp+tPYnrsy9dfh7ZbT8DxesH5ZnI= -github.com/pion/sdp/v3 v3.0.18/go.mod h1:ZREGo6A9ZygQ9XkqAj5xYCQtQpif0i6Pa81HOiAdqQ8= +github.com/pion/sdp/v3 v3.0.19 h1:1VMKs3gIkTQV5M3hNKfTAPrDXSNrYtOlmOD8+mSZUGQ= +github.com/pion/sdp/v3 v3.0.19/go.mod h1:dE5WOSlzXrtiE/iuZqe9n+AcEbOjtAd3k5m5NtlV/qU= github.com/pion/srtp/v3 v3.0.11 h1:GiESUr54/K4UuPigfq/CvWUed80JenQAHXn0C2MQQIQ= github.com/pion/srtp/v3 v3.0.11/go.mod h1:EeZOi/sd6glM1EXapg051gdNWO9yWT1YSsgQ4SlJkns= -github.com/pion/stun/v3 v3.1.4 h1:/7ZL0j0dmLroKOq4GfkyKQ6asByYqntwyHSp5sYLcGY= -github.com/pion/stun/v3 v3.1.4/go.mod h1:ET7PFiXo1nrD2ZNVpbEHDuT0kCPVXhKmyWdiePNMw/U= +github.com/pion/stun/v3 v3.1.5 h1:Y1FHlhaI6+4UoC5i/zQf4F7JvdZtB24/05oyy/GF1x8= +github.com/pion/stun/v3 v3.1.5/go.mod h1:zRUghXSQU32Lx5orJsz3uYMkIihweXb3mu5gIns02fs= github.com/pion/transport/v3 v3.1.1 h1:Tr684+fnnKlhPceU+ICdrw6KKkTms+5qHMgw6bIkYOM= github.com/pion/transport/v3 v3.1.1/go.mod h1:+c2eewC5WJQHiAA46fkMMzoYZSuGzA/7E2FPrOYHctQ= github.com/pion/transport/v4 v4.0.2 h1:ifYlPqNwsy6aKQ9y8yzxXlHae5431ZrH2avkD/Rn6Tk= github.com/pion/transport/v4 v4.0.2/go.mod h1:06hFI+jCFcok2X2MekVufNZ/uzNZXivGBPfviSVcjgM= -github.com/pion/turn/v5 v5.0.8 h1:pZUCtmwWCMkrRKqh/8pL3WoGADXBe0/lOPkN7oqFjK8= -github.com/pion/turn/v5 v5.0.8/go.mod h1:1VwvxElZaOdJU0liJ/WUSm/Tsh+n2OxS5ISSDxgOWxU= -github.com/pion/webrtc/v4 v4.2.14 h1:Q6zMs+fSDsYuhZcNlvFGBxCOMHVV9oYcDa6O9/HIGTc= -github.com/pion/webrtc/v4 v4.2.14/go.mod h1:87NVKP86+g4OMrRxWhjWfUjeXP4JrV6RTlUrIW+/Jak= +github.com/pion/turn/v5 v5.0.9 h1:zNeBfRyzGn7MPyUTvmvxeltLEjlFdSLPT1tlakoaOXM= +github.com/pion/turn/v5 v5.0.9/go.mod h1:u3XjBqy2Z4+NhCUpDoOSsNuQDrPLvKStlCGWk6sTQ1E= +github.com/pion/webrtc/v4 v4.2.15 h1:Ir/MauNFCfg+kgyBYPQLiGdVWFlzEcLxqtuzAkYkky0= +github.com/pion/webrtc/v4 v4.2.15/go.mod h1:CPTcyLfIzC4scOkQ4UY4pj6WvbUGhcNLIpK28cP5h6M= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= From 3af6484f7d476df1cfb9552541dd0973eaf9eac1 Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Wed, 15 Jul 2026 14:54:30 -0600 Subject: [PATCH 2/2] chore(deps): bump version --- go.mod | 4 +--- go.sum | 2 ++ version.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2ed640a0..40900f39 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/joho/godotenv v1.5.1 github.com/klauspost/compress v1.18.6 github.com/livekit/protocol v1.49.1-0.20260712215709-8847d7456816 - github.com/livekit/server-sdk-go/v2 v2.17.0 + github.com/livekit/server-sdk-go/v2 v2.18.1 github.com/mattn/go-isatty v0.0.22 github.com/moby/patternmatcher v0.6.1 github.com/modelcontextprotocol/go-sdk v1.6.1 @@ -268,5 +268,3 @@ require ( // TEMP (local dev): use local protocol with the WorkerInfo dev message. // Drop once github.com/livekit/protocol publishes it. // replace github.com/livekit/protocol => ../protocol - -replace github.com/livekit/server-sdk-go/v2 => ../server-sdk-go diff --git a/go.sum b/go.sum index 62109edc..41036b10 100644 --- a/go.sum +++ b/go.sum @@ -361,6 +361,8 @@ github.com/livekit/protocol v1.49.1-0.20260712215709-8847d7456816 h1:MDWDlH5dmcZ github.com/livekit/protocol v1.49.1-0.20260712215709-8847d7456816/go.mod h1:jO+y05AU9Ec4JswDyuzKCZ4bhziOS0CzMqgnbj60Dzs= github.com/livekit/psrpc v0.7.2 h1:6oZ+NODJ2pLyaT6VqDq1F4Qc/3TpDUSpyphj/P9MhQc= github.com/livekit/psrpc v0.7.2/go.mod h1:rAI+m2+/cb4x9RXhLRtUx5ZwdfjjXOl4zi46IjEetaw= +github.com/livekit/server-sdk-go/v2 v2.18.1 h1:/u0JVII+ErGCivHnAGr6di0wl0NYsfcRvDzEtTAFovo= +github.com/livekit/server-sdk-go/v2 v2.18.1/go.mod h1:su0IvJNWTFCHVwmqpsFvxHfXWs9pn26ms+cKBR1jILU= 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= diff --git a/version.go b/version.go index f0add2b6..e82529ea 100644 --- a/version.go +++ b/version.go @@ -15,5 +15,5 @@ package livekitcli const ( - Version = "2.17.0" + Version = "2.18.0" )