@@ -85,8 +85,8 @@ type Options struct {
85
85
}
86
86
87
87
type Client interface {
88
- ConnectRPC23 (ctx context.Context ) (
89
- proto.DRPCAgentClient23 , tailnetproto.DRPCTailnetClient23 ,error ,
88
+ ConnectRPC24 (ctx context.Context ) (
89
+ proto.DRPCAgentClient24 , tailnetproto.DRPCTailnetClient24 ,error ,
90
90
)
91
91
RewriteDERPMap (derpMap * tailcfg.DERPMap )
92
92
}
@@ -362,7 +362,6 @@ func (a *agent) collectMetadata(ctx context.Context, md codersdk.WorkspaceAgentM
362
362
// Important: if the command times out, we may see a misleading error like
363
363
// "exit status 1", so it's important to include the context error.
364
364
err = errors .Join (err ,ctx .Err ())
365
-
366
365
if err != nil {
367
366
result .Error = fmt .Sprintf ("run cmd: %+v" ,err )
368
367
}
@@ -399,7 +398,7 @@ func (t *trySingleflight) Do(key string, fn func()) {
399
398
fn ()
400
399
}
401
400
402
- func (a * agent )reportMetadata (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
401
+ func (a * agent )reportMetadata (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
403
402
tickerDone := make (chan struct {})
404
403
collectDone := make (chan struct {})
405
404
ctx ,cancel := context .WithCancel (ctx )
@@ -615,7 +614,7 @@ func (a *agent) reportMetadata(ctx context.Context, aAPI proto.DRPCAgentClient23
615
614
616
615
// reportLifecycle reports the current lifecycle state once. All state
617
616
// changes are reported in order.
618
- func (a * agent )reportLifecycle (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
617
+ func (a * agent )reportLifecycle (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
619
618
for {
620
619
select {
621
620
case <- a .lifecycleUpdate :
@@ -697,7 +696,7 @@ func (a *agent) setLifecycle(state codersdk.WorkspaceAgentLifecycle) {
697
696
// fetchServiceBannerLoop fetches the service banner on an interval. It will
698
697
// not be fetched immediately; the expectation is that it is primed elsewhere
699
698
// (and must be done before the session actually starts).
700
- func (a * agent )fetchServiceBannerLoop (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
699
+ func (a * agent )fetchServiceBannerLoop (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
701
700
ticker := time .NewTicker (a .announcementBannersRefreshInterval )
702
701
defer ticker .Stop ()
703
702
for {
@@ -733,7 +732,7 @@ func (a *agent) run() (retErr error) {
733
732
a .sessionToken .Store (& sessionToken )
734
733
735
734
// ConnectRPC returns the dRPC connection we use for the Agent and Tailnet v2+ APIs
736
- aAPI ,tAPI ,err := a .client .ConnectRPC23 (a .hardCtx )
735
+ aAPI ,tAPI ,err := a .client .ConnectRPC24 (a .hardCtx )
737
736
if err != nil {
738
737
return err
739
738
}
@@ -750,7 +749,7 @@ func (a *agent) run() (retErr error) {
750
749
connMan := newAPIConnRoutineManager (a .gracefulCtx ,a .hardCtx ,a .logger ,aAPI ,tAPI )
751
750
752
751
connMan .startAgentAPI ("init notification banners" ,gracefulShutdownBehaviorStop ,
753
- func (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
752
+ func (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
754
753
bannersProto ,err := aAPI .GetAnnouncementBanners (ctx ,& proto.GetAnnouncementBannersRequest {})
755
754
if err != nil {
756
755
return xerrors .Errorf ("fetch service banner: %w" ,err )
@@ -767,7 +766,7 @@ func (a *agent) run() (retErr error) {
767
766
// sending logs gets gracefulShutdownBehaviorRemain because we want to send logs generated by
768
767
// shutdown scripts.
769
768
connMan .startAgentAPI ("send logs" ,gracefulShutdownBehaviorRemain ,
770
- func (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
769
+ func (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
771
770
err := a .logSender .SendLoop (ctx ,aAPI )
772
771
if xerrors .Is (err ,agentsdk .LogLimitExceededError ) {
773
772
// we don't want this error to tear down the API connection and propagate to the
@@ -807,7 +806,7 @@ func (a *agent) run() (retErr error) {
807
806
connMan .startAgentAPI ("handle manifest" ,gracefulShutdownBehaviorStop ,a .handleManifest (manifestOK ))
808
807
809
808
connMan .startAgentAPI ("app health reporter" ,gracefulShutdownBehaviorStop ,
810
- func (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
809
+ func (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
811
810
if err := manifestOK .wait (ctx );err != nil {
812
811
return xerrors .Errorf ("no manifest: %w" ,err )
813
812
}
@@ -840,7 +839,7 @@ func (a *agent) run() (retErr error) {
840
839
841
840
connMan .startAgentAPI ("fetch service banner loop" ,gracefulShutdownBehaviorStop ,a .fetchServiceBannerLoop )
842
841
843
- connMan .startAgentAPI ("stats report loop" ,gracefulShutdownBehaviorStop ,func (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
842
+ connMan .startAgentAPI ("stats report loop" ,gracefulShutdownBehaviorStop ,func (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
844
843
if err := networkOK .wait (ctx );err != nil {
845
844
return xerrors .Errorf ("no network: %w" ,err )
846
845
}
@@ -851,8 +850,8 @@ func (a *agent) run() (retErr error) {
851
850
}
852
851
853
852
// handleManifest returns a function that fetches and processes the manifest
854
- func (a * agent )handleManifest (manifestOK * checkpoint )func (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
855
- return func (ctx context.Context ,aAPI proto.DRPCAgentClient23 )error {
853
+ func (a * agent )handleManifest (manifestOK * checkpoint )func (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
854
+ return func (ctx context.Context ,aAPI proto.DRPCAgentClient24 )error {
856
855
var (
857
856
sentResult = false
858
857
err error
@@ -961,8 +960,8 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
961
960
962
961
// createOrUpdateNetwork waits for the manifest to be set using manifestOK, then creates or updates
963
962
// the tailnet using the information in the manifest
964
- func (a * agent )createOrUpdateNetwork (manifestOK ,networkOK * checkpoint )func (context.Context , proto.DRPCAgentClient23 )error {
965
- return func (ctx context.Context ,_ proto.DRPCAgentClient23 ) (retErr error ) {
963
+ func (a * agent )createOrUpdateNetwork (manifestOK ,networkOK * checkpoint )func (context.Context , proto.DRPCAgentClient24 )error {
964
+ return func (ctx context.Context ,_ proto.DRPCAgentClient24 ) (retErr error ) {
966
965
if err := manifestOK .wait (ctx );err != nil {
967
966
return xerrors .Errorf ("no manifest: %w" ,err )
968
967
}
@@ -1683,7 +1682,7 @@ const (
1683
1682
1684
1683
type apiConnRoutineManager struct {
1685
1684
logger slog.Logger
1686
- aAPI proto.DRPCAgentClient23
1685
+ aAPI proto.DRPCAgentClient24
1687
1686
tAPI tailnetproto.DRPCTailnetClient23
1688
1687
eg * errgroup.Group
1689
1688
stopCtx context.Context
@@ -1692,7 +1691,7 @@ type apiConnRoutineManager struct {
1692
1691
1693
1692
func newAPIConnRoutineManager (
1694
1693
gracefulCtx ,hardCtx context.Context ,logger slog.Logger ,
1695
- aAPI proto.DRPCAgentClient23 ,tAPI tailnetproto.DRPCTailnetClient23 ,
1694
+ aAPI proto.DRPCAgentClient24 ,tAPI tailnetproto.DRPCTailnetClient23 ,
1696
1695
)* apiConnRoutineManager {
1697
1696
// routines that remain in operation during graceful shutdown use the remainCtx. They'll still
1698
1697
// exit if the errgroup hits an error, which usually means a problem with the conn.
@@ -1725,7 +1724,7 @@ func newAPIConnRoutineManager(
1725
1724
// but for Tailnet.
1726
1725
func (a * apiConnRoutineManager )startAgentAPI (
1727
1726
name string ,behavior gracefulShutdownBehavior ,
1728
- f func (context.Context , proto.DRPCAgentClient23 )error ,
1727
+ f func (context.Context , proto.DRPCAgentClient24 )error ,
1729
1728
) {
1730
1729
logger := a .logger .With (slog .F ("name" ,name ))
1731
1730
var ctx context.Context