@@ -68,26 +68,27 @@ const (
68
68
)
69
69
70
70
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
+ ExperimentalContainersEnabled bool
91
92
}
92
93
93
94
type Client interface {
@@ -184,10 +185,11 @@ func New(options Options) Agent {
184
185
logSender : agentsdk .NewLogSender (options .Logger ),
185
186
blockFileTransfer : options .BlockFileTransfer ,
186
187
187
- prometheusRegistry : prometheusRegistry ,
188
- metrics : newAgentMetrics (prometheusRegistry ),
189
- execer : options .Execer ,
190
- lister : options .ContainerLister ,
188
+ prometheusRegistry : prometheusRegistry ,
189
+ metrics : newAgentMetrics (prometheusRegistry ),
190
+ execer : options .Execer ,
191
+ lister : options .ContainerLister ,
192
+ experimentalDevcontainersEnabled : options .ExperimentalContainersEnabled ,
191
193
}
192
194
// Initially, we have a closed channel, reflecting the fact that we are not initially connected.
193
195
// Each time we connect we replace the channel (while holding the closeMutex) with a new one
@@ -255,9 +257,10 @@ type agent struct {
255
257
prometheusRegistry * prometheus.Registry
256
258
// metrics are prometheus registered metrics that will be collected and
257
259
// labeled in Coder with the agent + workspace.
258
- metrics * agentMetrics
259
- execer agentexec.Execer
260
- lister agentcontainers.Lister
260
+ metrics * agentMetrics
261
+ execer agentexec.Execer
262
+ lister agentcontainers.Lister
263
+ experimentalDevcontainersEnabled bool
261
264
}
262
265
263
266
func (a * agent ) TailnetConn () * tailnet.Conn {
@@ -297,6 +300,9 @@ func (a *agent) init() {
297
300
a .sshServer ,
298
301
a .metrics .connectionsTotal , a .metrics .reconnectingPTYErrors ,
299
302
a .reconnectingPTYTimeout ,
303
+ func (s * reconnectingpty.Server ) {
304
+ s .ExperimentalContainersEnabled = a .experimentalDevcontainersEnabled
305
+ },
300
306
)
301
307
go a .runLoop ()
302
308
}
0 commit comments