@@ -43,7 +43,7 @@ type API struct {
43
43
logger slog.Logger
44
44
watcher watcher.Watcher
45
45
execer agentexec.Execer
46
- cl Lister
46
+ ccli ContainerCLI
47
47
dccli DevcontainerCLI
48
48
clock quartz.Clock
49
49
scriptLogger func (logSourceID uuid.UUID ) ScriptLogger
@@ -80,11 +80,11 @@ func WithExecer(execer agentexec.Execer) Option {
80
80
}
81
81
}
82
82
83
- // WithLister sets the agentcontainers.Lister implementation to use.
84
- // The default implementation uses the Docker CLI to list containers .
85
- func WithLister ( cl Lister ) Option {
83
+ // WithContainerCLI sets the agentcontainers.ContainerCLI implementation
84
+ // to use. The default implementation uses the Docker CLI.
85
+ func WithContainerCLI ( ccli ContainerCLI ) Option {
86
86
return func (api * API ) {
87
- api .cl = cl
87
+ api .ccli = ccli
88
88
}
89
89
}
90
90
@@ -186,8 +186,8 @@ func NewAPI(logger slog.Logger, options ...Option) *API {
186
186
for _ , opt := range options {
187
187
opt (api )
188
188
}
189
- if api .cl == nil {
190
- api .cl = NewDocker (api .execer )
189
+ if api .ccli == nil {
190
+ api .ccli = NewDockerCLI (api .execer )
191
191
}
192
192
if api .dccli == nil {
193
193
api .dccli = NewDevcontainerCLI (logger .Named ("devcontainer-cli" ), api .execer )
@@ -363,7 +363,7 @@ func (api *API) updateContainers(ctx context.Context) error {
363
363
listCtx , listCancel := context .WithTimeout (ctx , listContainersTimeout )
364
364
defer listCancel ()
365
365
366
- updated , err := api .cl .List (listCtx )
366
+ updated , err := api .ccli .List (listCtx )
367
367
if err != nil {
368
368
// If the context was canceled, we hold off on clearing the
369
369
// containers cache. This is to avoid clearing the cache if
0 commit comments