mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: move proto to sdk conversion to agentsdk (#11831)
`agentsdk` depends on `agent/proto` because it needs to get the version to dial. Therefore, the conversion routines need to live in `agentsdk` so that we can convert to and from the Manifest. I briefly considered refactoring the agent to only reference `proto.Manifest`, but decided against it because we might have multiple protocol versions in the future, its useful to have a protocol-independent data structure.
This commit is contained in:
+2
-2
@@ -677,7 +677,7 @@ func (a *agent) fetchServiceBannerLoop(ctx context.Context, aAPI proto.DRPCAgent
|
||||
a.logger.Error(ctx, "failed to update service banner", slog.Error(err))
|
||||
return err
|
||||
}
|
||||
serviceBanner := proto.SDKServiceBannerFromProto(sbp)
|
||||
serviceBanner := agentsdk.ServiceBannerFromProto(sbp)
|
||||
a.serviceBanner.Store(&serviceBanner)
|
||||
}
|
||||
}
|
||||
@@ -710,7 +710,7 @@ func (a *agent) run(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return xerrors.Errorf("fetch service banner: %w", err)
|
||||
}
|
||||
serviceBanner := proto.SDKServiceBannerFromProto(sbp)
|
||||
serviceBanner := agentsdk.ServiceBannerFromProto(sbp)
|
||||
a.serviceBanner.Store(&serviceBanner)
|
||||
|
||||
manifest, err := a.client.Manifest(ctx)
|
||||
|
||||
Reference in New Issue
Block a user