Skip to content

Commit 12389d8

Browse files
committed
reduce diff size
1 parent aafe13f commit 12389d8

File tree

3 files changed

+43
-38
lines changed

3 files changed

+43
-38
lines changed

agent/agent.go

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,27 @@ const (
6868
)
6969

7070
type Options struct {
71-
Filesystem afero.Fs
72-
LogDir string
73-
TempDir string
74-
ScriptDataDir string
75-
ExchangeToken func(ctx context.Context) (string, error)
76-
Client Client
77-
ReconnectingPTYTimeout time.Duration
78-
EnvironmentVariables map[string]string
79-
Logger slog.Logger
80-
IgnorePorts map[int]string
81-
PortCacheDuration time.Duration
82-
SSHMaxTimeout time.Duration
83-
TailnetListenPort uint16
84-
Subsystems []codersdk.AgentSubsystem
85-
PrometheusRegistry *prometheus.Registry
86-
ReportMetadataInterval time.Duration
87-
ServiceBannerRefreshInterval time.Duration
88-
BlockFileTransfer bool
89-
Execer agentexec.Execer
90-
ContainerLister agentcontainers.Lister
71+
Filesystem afero.Fs
72+
LogDir string
73+
TempDir string
74+
ScriptDataDir string
75+
ExchangeToken func(ctx context.Context) (string, error)
76+
Client Client
77+
ReconnectingPTYTimeout time.Duration
78+
EnvironmentVariables map[string]string
79+
Logger slog.Logger
80+
IgnorePorts map[int]string
81+
PortCacheDuration time.Duration
82+
SSHMaxTimeout time.Duration
83+
TailnetListenPort uint16
84+
Subsystems []codersdk.AgentSubsystem
85+
PrometheusRegistry *prometheus.Registry
86+
ReportMetadataInterval time.Duration
87+
ServiceBannerRefreshInterval time.Duration
88+
BlockFileTransfer bool
89+
Execer agentexec.Execer
90+
ContainerLister agentcontainers.Lister
91+
9192
ExperimentalContainersEnabled bool
9293
}
9394

@@ -185,10 +186,11 @@ func New(options Options) Agent {
185186
logSender: agentsdk.NewLogSender(options.Logger),
186187
blockFileTransfer: options.BlockFileTransfer,
187188

188-
prometheusRegistry: prometheusRegistry,
189-
metrics: newAgentMetrics(prometheusRegistry),
190-
execer: options.Execer,
191-
lister: options.ContainerLister,
189+
prometheusRegistry: prometheusRegistry,
190+
metrics: newAgentMetrics(prometheusRegistry),
191+
execer: options.Execer,
192+
lister: options.ContainerLister,
193+
192194
experimentalDevcontainersEnabled: options.ExperimentalContainersEnabled,
193195
}
194196
// Initially, we have a closed channel, reflecting the fact that we are not initially connected.
@@ -257,9 +259,10 @@ type agent struct {
257259
prometheusRegistry *prometheus.Registry
258260
// metrics are prometheus registered metrics that will be collected and
259261
// labeled in Coder with the agent + workspace.
260-
metrics *agentMetrics
261-
execer agentexec.Execer
262-
lister agentcontainers.Lister
262+
metrics *agentMetrics
263+
execer agentexec.Execer
264+
lister agentcontainers.Lister
265+
263266
experimentalDevcontainersEnabled bool
264267
}
265268

agent/reconnectingpty/server.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ import (
2121
)
2222

2323
type Server struct {
24-
logger slog.Logger
25-
connectionsTotal prometheus.Counter
26-
errorsTotal *prometheus.CounterVec
27-
commandCreator *agentssh.Server
28-
connCount atomic.Int64
29-
reconnectingPTYs sync.Map
30-
timeout time.Duration
24+
logger slog.Logger
25+
connectionsTotal prometheus.Counter
26+
errorsTotal *prometheus.CounterVec
27+
commandCreator *agentssh.Server
28+
connCount atomic.Int64
29+
reconnectingPTYs sync.Map
30+
timeout time.Duration
31+
3132
ExperimentalContainersEnabled bool
3233
}
3334

cli/agent.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,11 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
347347
SSHMaxTimeout: sshMaxTimeout,
348348
Subsystems: subsystems,
349349

350-
PrometheusRegistry: prometheusRegistry,
351-
BlockFileTransfer: blockFileTransfer,
352-
Execer: execer,
353-
ContainerLister: containerLister,
350+
PrometheusRegistry: prometheusRegistry,
351+
BlockFileTransfer: blockFileTransfer,
352+
Execer: execer,
353+
ContainerLister: containerLister,
354+
354355
ExperimentalContainersEnabled: devcontainersEnabled,
355356
})
356357

0 commit comments

Comments
 (0)