Skip to content

Commit e3e839e

Browse files
committed
Add labels to challenge instance containers
Adds the label `cmgr.managed=true` to all challenge containers started by cmgr. Additionally, adds the label `cmgr.dynamic=<bool>`, indicating whether or not the instance is part of a build with `instance_count: -1`.
1 parent 4ed9aee commit e3e839e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: cmgr/docker.go

+11
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,21 @@ func (m *Manager) startContainers(build *BuildMetadata, instance *InstanceMetada
662662
}
663663
}
664664

665+
isDynamicInstance := "false"
666+
if build.InstanceCount == DYNAMIC_INSTANCES {
667+
isDynamicInstance = "true"
668+
}
669+
670+
cLabels := map[string]string{
671+
"cmgr.managed": "true",
672+
"cmgr.dynamic": isDynamicInstance,
673+
}
674+
665675
cConfig := container.Config{
666676
Image: fmt.Sprintf("%s:%s", build.Challenge, build.dockerId(image)),
667677
Hostname: image.Host,
668678
ExposedPorts: exposedPorts,
679+
Labels: cLabels,
669680
}
670681

671682
hConfig := container.HostConfig{

0 commit comments

Comments
 (0)