Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.25.0
-
None
-
None
Description
I'm building an agent module which uses both the Isolator interface[1] to track containers over their lifespan, and the Hook interface[2] to inject environment variables into those containers.
Nearly all of the Isolator interface calls include the ContainerID, sometimes as the sole identifier. Meanwhile the Hook.slaveExecutorEnvironmentDecorator call is only given an ExecutorInfo, and doesn't have a ContainerID at all.
At the moment I'm working around the lack of ContainerID in the Hook call by storing a temporary ExecutorInfo->ContainerID mapping when Isolator.prepare() is called, then reading/clearing that mapping when Hook.slaveExecutorEnvironmentDecorator() is called. While this workaround appears to work for now, I worry that it will be brittle in the future, since it depends on Isolator.prepare() consistently being called before Hook.slaveExecutorEnvironmentDecorator().
The immediate issue is specific to including a ContainerID parameter within Hook.slaveExecutorEnvironmentDecorator(), but it may make sense to determine if other Hook calls should have similar updates.
[1] https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob;f=include/mesos/slave/isolator.hpp
[2] https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob;f=include/mesos/hook.hpp