Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions router/pump.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ func ignoreContainer(container *docker.Container) bool {
if value, ok := container.Config.Labels[excludeLabel]; ok {
return len(excludeLabel) > 0 && strings.ToLower(value) == "true"
}
includeLabel := getopt("INCLUDE_LABEL", "")
if includeLabel != "" {
if _, ok := container.Config.Labels[includeLabel]; ok {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this check isn't similar to the exclude check where we check the actual value?

// include all containers that have the includeLabel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments shouldn't be necessary, and if they are, the code needs to be made more clear.

return false
} else {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the explicit else if the above will return false.

// ignore all containers that don't have the includeLabel
return true
}
}
return false
}

Expand Down