mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00: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:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/coder/coder/v2/agent/proto"
|
||||
"github.com/coder/coder/v2/coderd/appearance"
|
||||
"github.com/coder/coder/v2/codersdk/agentsdk"
|
||||
)
|
||||
|
||||
type ServiceBannerAPI struct {
|
||||
@@ -19,5 +20,5 @@ func (a *ServiceBannerAPI) GetServiceBanner(ctx context.Context, _ *proto.GetSer
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("fetch appearance: %w", err)
|
||||
}
|
||||
return proto.ServiceBannerFromSDK(cfg.ServiceBanner), nil
|
||||
return agentsdk.ProtoFromServiceBanner(cfg.ServiceBanner), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user