JeanRev / TeamcityDockerCloudPlugin

Docker Cloud Plugin for the TeamCity build server
Apache License 2.0
33 stars 10 forks source link

Auto-launched containers shown as test containers and are disabled #13

Closed JayeshS closed 7 years ago

JayeshS commented 7 years ago

When the plugin launches new agent containers, they all seem to automatically be marked as 'test' and disabled as per Known-limitations How does the plugin determine that its a test container? It was not started via the test functionality in the plugin configuration. However, I had previously started that docker image as a test container and then created a new image from it - is that the reason?

JayeshS commented 7 years ago

That was it.
The image I was using was created off a running container which was in test mode. 😃

JeanRev commented 7 years ago

Ok :-) This behavior is indeed expected. When committing an image, all the container settings such as environment variables and labels will be persisted in the new image, including those used by the plugin to track managed containers. If the committed container was a "test"container, the newly started instance will then be recognized as such by the test controller, and it will be immediately disabled (test containers should not accept any build jobs).

That being said, committing a test container to use it as an agent image can be considered a legitimate use case. The possible improvement I see would be to remove all prior, plugin-related, meta-data when starting new containers. This would prevent the described scenario.

I created a new issue to track this: #14

Thank you for reporting