-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Env variable NO_WINDOWS_SERVICE to force interactive mode on Windows #254
Env variable NO_WINDOWS_SERVICE to force interactive mode on Windows #254
Conversation
This is a copy of the main repo PR: open-telemetry/opentelemetry-collector#2272 that enables running the collector inside Windows Docker containers. Main repo PR description: > Adding a feature - adds a check for NO_WINDOWS_SERVICE environment variable on Windows to allow forcing interactive mode instead of running as a service. > > This is required for using the collector in Windows Docker containers, as at least some of the Windows base images do not support services (fails with "The service process could not connect to the service controller"). Environment variable is used instead of automatic detection of Docker as it is uncertain if images that support services are possible and/or desired. > >Running collector in Windows Docker containers is required to perform containerized integration tests of agents on Windows. We want to use splunk-otel-collector in our splunk-otel-java smoke-tests, and that includes Windows tests. This change is required to make Windows containers work.
Codecov Report
@@ Coverage Diff @@
## main #254 +/- ##
==========================================
- Coverage 87.55% 86.90% -0.66%
==========================================
Files 19 19
Lines 1463 1474 +11
==========================================
Hits 1281 1281
- Misses 147 158 +11
Partials 35 35
Continue to review full report at Codecov.
|
// than 0, use interactive mode instead of running as a service. This should | ||
// be set in case running as a service is not possible or desired even | ||
// though the current session is not detected to be interactive | ||
if value, present := os.LookupEnv("NO_WINDOWS_SERVICE"); present && value != "0" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunate there's a double negative ("no" & 0) as opposed to something like WINDOWS_INTERACTIVE
, but deviating may not be desired...
Would you mind opening an issue for adding an integration test for this? We have a windows test env that would be adequate but none of the integration tests are enabled in CI yet. You of course could also add an integration test in this PR if you wanted ;) |
I'll create an issue for that 😄 |
This is a copy of the main repo PR: open-telemetry/opentelemetry-collector#2272 that enables running the collector inside Windows Docker containers.
Main repo PR description:
We want to use splunk-otel-collector in our splunk-otel-java smoke-tests, and that includes Windows tests. This change is required to make Windows containers work.