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

Commitcc4f8da

Browse files
fix(agent/agentcontainers): fix devcontainer integration tests (#19109)
It appears we accidentally merged a change that broke our devcontainerintegration tests#18570.
1 parente4dc2d9 commitcc4f8da

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎agent/agentcontainers/api.go‎

Lines changed: 13 additions & 8 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,17 +927,22 @@ 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+
includeContainer:=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+
includeContainer=includeContainer&& (found&&v==value)
937942
}
938943
// Verbose debug logging is fine here since typically filters
939944
// are only used in development or testing environments.
940-
if!ok {
945+
if!includeContainer {
941946
logger.Debug(ctx,"container does not match include filter, ignoring devcontainer",slog.F("container_labels",container.Labels),slog.F("include_filter",api.containerLabelIncludeFilter))
942947
continue
943948
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp