feat: use appearance.Fetcher in agentapi (#11770)

This PR updates the Agent API to use the appearance.Fetcher, which is set by entitlement code in Enterprise coderd.

This brings the agentapi into compliance with the Enterprise feature.
This commit is contained in:
Spike Curtis
2024-01-29 21:22:50 +04:00
committed by GitHub
parent f54278cdfe
commit 207328ca50
7 changed files with 120 additions and 109 deletions
+3 -1
View File
@@ -17,6 +17,7 @@ import (
"cdr.dev/slog"
agentproto "github.com/coder/coder/v2/agent/proto"
"github.com/coder/coder/v2/coderd/appearance"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/pubsub"
"github.com/coder/coder/v2/coderd/externalauth"
@@ -61,6 +62,7 @@ type Options struct {
TailnetCoordinator *atomic.Pointer[tailnet.Coordinator]
TemplateScheduleStore *atomic.Pointer[schedule.TemplateScheduleStore]
StatsBatcher StatsBatcher
AppearanceFetcher *atomic.Pointer[appearance.Fetcher]
PublishWorkspaceUpdateFn func(ctx context.Context, workspaceID uuid.UUID)
PublishWorkspaceAgentLogsUpdateFn func(ctx context.Context, workspaceAgentID uuid.UUID, msg agentsdk.LogsNotifyMessage)
@@ -98,7 +100,7 @@ func New(opts Options) *API {
}
api.ServiceBannerAPI = &ServiceBannerAPI{
Database: opts.Database,
appearanceFetcher: opts.AppearanceFetcher,
}
api.StatsAPI = &StatsAPI{