Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7419dd2

Browse files
fix(agent/agentcontainers): fix devcontainer integration tests
1 parente4dc2d9 commit7419dd2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎agent/agentcontainers/api.go‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ func WithContainerCLI(ccli ContainerCLI) Option {
161161

162162
// WithContainerLabelIncludeFilter sets a label filter for containers.
163163
// This option can be given multiple times to filter by multiple labels.
164-
// The behavior is such that only containers matchingone or moreof the
165-
//providedlabels will be included.
164+
// The behavior is such that only containers matchingallof the provided
165+
// labels will be included.
166166
funcWithContainerLabelIncludeFilter(label,valuestring)Option {
167167
returnfunc(api*API) {
168168
api.containerLabelIncludeFilter[label]=value
@@ -927,13 +927,18 @@ func (api *API) processUpdatedContainersLocked(ctx context.Context, updated code
927927
slog.F("config_file",configFile),
928928
)
929929

930+
// If we haven't set any include filters, we should explicitly ignore test devcontainers.
931+
iflen(api.containerLabelIncludeFilter)==0&&container.Labels[DevcontainerIsTestRunLabel]=="true" {
932+
continue
933+
}
934+
930935
// Filter out devcontainer tests, unless explicitly set in include filters.
931-
iflen(api.containerLabelIncludeFilter)>0||container.Labels[DevcontainerIsTestRunLabel]=="true"{
932-
varokbool
936+
iflen(api.containerLabelIncludeFilter)>0 {
937+
ok:=true
933938
forlabel,value:=rangeapi.containerLabelIncludeFilter {
934-
ifv,found:=container.Labels[label];found&&v==value {
935-
ok=true
936-
}
939+
v,found:=container.Labels[label]
940+
941+
ok=ok&& (found&&v==value)
937942
}
938943
// Verbose debug logging is fine here since typically filters
939944
// are only used in development or testing environments.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp