@@ -90,8 +90,8 @@ type Options struct {
90
90
BlockFileTransfer bool
91
91
Execer agentexec.Execer
92
92
93
- ContainerAPIOptions []agentcontainers.Option
94
93
ExperimentalDevcontainersEnabled bool
94
+ ContainerAPIOptions []agentcontainers.Option // Enable ExperimentalDevcontainersEnabled for these to be effective.
95
95
}
96
96
97
97
type Client interface {
@@ -190,8 +190,8 @@ func New(options Options) Agent {
190
190
metrics : newAgentMetrics (prometheusRegistry ),
191
191
execer : options .Execer ,
192
192
193
- containerAPIOptions : options .ContainerAPIOptions ,
194
193
experimentalDevcontainersEnabled : options .ExperimentalDevcontainersEnabled ,
194
+ containerAPIOptions : options .ContainerAPIOptions ,
195
195
}
196
196
// Initially, we have a closed channel, reflecting the fact that we are not initially connected.
197
197
// Each time we connect we replace the channel (while holding the closeMutex) with a new one
@@ -274,7 +274,7 @@ type agent struct {
274
274
275
275
experimentalDevcontainersEnabled bool
276
276
containerAPIOptions []agentcontainers.Option
277
- containerAPI * agentcontainers.API
277
+ containerAPI atomic. Pointer [ agentcontainers.API ] // Set by apiHandler.
278
278
}
279
279
280
280
func (a * agent ) TailnetConn () * tailnet.Conn {
@@ -1168,11 +1168,11 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
1168
1168
}
1169
1169
a .metrics .startupScriptSeconds .WithLabelValues (label ).Set (dur )
1170
1170
a .scriptRunner .StartCron ()
1171
- if a . containerAPI != nil {
1171
+ if containerAPI := a . containerAPI . Load (); containerAPI != nil {
1172
1172
// Inform the container API that the agent is ready.
1173
1173
// This allows us to start watching for changes to
1174
1174
// the devcontainer configuration files.
1175
- a . containerAPI .SignalReady ()
1175
+ containerAPI .SignalReady ()
1176
1176
}
1177
1177
})
1178
1178
if err != nil {
0 commit comments