Skip to content

WINC-2046: Adds log file to windows-exporter - #4355

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
wgahnagl:WINC-1979
Aug 21, 2026
Merged

openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
wgahnagl:WINC-1979

Conversation

@wgahnagl

@wgahnagl wgahnagl commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

This allows windows-exporter to use a log file, and use the globally configurable log files.

Summary by CodeRabbit

  • New Features

    • Windows exporter services now support configurable logging levels, using detailed debug logging when debug mode is enabled and standard informational logging otherwise.
    • Exporter logs are written to a dedicated log file for easier troubleshooting and monitoring.
  • Bug Fixes

    • Windows exporter logs are now included in required system log collection, improving diagnostic coverage.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 20, 2026
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (2)
  • do-not-merge/work-in-progress
  • do-not-merge/hold

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 113453da-a01d-4be3-b533-1222fcb343a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 58beb92e-0450-4b79-a214-56886b7b0cce

📥 Commits

Reviewing files that changed from the base of the PR and between 603768b and 9673eac.

📒 Files selected for processing (4)
  • pkg/services/services.go
  • pkg/services/services_test.go
  • pkg/windows/windows.go
  • test/e2e/logs_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

GenerateManifest now sets the Windows exporter log level to info or debug and passes the configured log file path. Windows exporter log constants and its required directory are added. Unit tests cover default and debug configurations. End-to-end log checks include windows_exporter.log.

Suggested reviewers: jrvaldes, mansikulkarni96

🚥 Pre-merge checks | ✅ 20
✅ Passed checks (20 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Go Best Practices & Build Tags ✅ Passed PASS: No ignored errors or panic were added. NewData returns nonnil data on nil error; the test uses require.NoError. Shared operator manifest code is not OS-specific, and daemon files remain windo...
Security: Secrets, Ssh & Csr ✅ Passed The diff only configures windows_exporter log level and file paths; it adds no secret, SSH, certificate, CSR, or credential handling behavior.
Kubernetes Controller Patterns ✅ Passed The diff changes service manifest arguments, Windows log constants/directories, and tests only; no reconciliation, requeue, status, predicate, finalizer, or owner-reference code changed.
Windows Service Management ✅ Passed The diff only changes the exporter command and log directory. Its priority and dependencies remain unchanged, while existing SCM reconciliation, descriptions, reverse-order cleanup, and reboot logi...
Platform-Specific Requirements ✅ Passed The PR changes only Windows exporter logging; vSphere limits, AWS EC2LaunchV2 2.0.1643+, Azure cloud-node-manager, and GCP hostname-script wiring remain documented and unchanged.
Stable And Deterministic Test Names ✅ Passed The PR adds only static subtest names, “Default logging” and “Debug logging enabled”; it adds no Ginkgo titles, and the existing node.Name t.Run title is unchanged.
Test Structure And Quality ✅ Passed The changed tests use Go testing.T, not Ginkgo. The unit test creates no resources, and the e2e log retrieval uses a bounded PollImmediate timeout.
Microshift Test Compatibility ✅ Passed The PR adds a standard Go unit test, not a new Ginkgo e2e test. Changed tests contain no Ginkgo constructs or MicroShift-unavailable API references.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit adds a standard Go unit test and extends an existing node-log check; it adds no Ginkgo e2e test or multi-node/HA assumption.
Topology-Aware Scheduling Compatibility ✅ Passed The parent-to-HEAD diff changes only Windows service logging, log directories, and tests; it adds no manifests, controllers, replicas, affinity, topology spread, selectors, tolerations, or PDBs.
Ote Binary Stdout Contract ✅ Passed The diff changes service configuration, Windows constants, and e2e log collection only; it adds no stdout writes or OTE entrypoint/suite-setup changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The diff adds a plain Go unit test and one log path; it adds no Ginkgo test, IPv4-only logic, or external network operation.
No-Weak-Crypto ✅ Passed The PR diff adds Windows exporter logging and log collection only. It introduces no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret/token comparisons; existing SHA-256 use is unchanged.
Container-Privileges ✅ Passed The pull request changes Windows service logging and tests only; no container or Kubernetes manifest privilege settings are changed or introduced.
No-Sensitive-Data-In-Logs ✅ Passed The diff adds only fixed windows_exporter log routing and info/debug selection; it passes no passwords, tokens, PII, hostnames, or customer data to logging.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding log file support to windows-exporter.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@wgahnagl wgahnagl changed the title adds log level and log file [WINC-1979] Adds log file to windows-exporter Jul 20, 2026
@wgahnagl wgahnagl closed this Jul 21, 2026
@wgahnagl wgahnagl reopened this Aug 11, 2026
@wgahnagl
wgahnagl marked this pull request as ready for review August 11, 2026 20:13
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 11, 2026
@wgahnagl wgahnagl changed the title [WINC-1979] Adds log file to windows-exporter [WINC-2046] Adds log file to windows-exporter Aug 11, 2026

@jrvaldes jrvaldes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wgahnagl thanks for working on this, PTAL at the comments

Comment thread pkg/services/services.go
Comment thread pkg/windows/windows.go
Comment thread pkg/services/services.go
@jrvaldes

Copy link
Copy Markdown
Contributor

after this merge, need to update the must-gather collection script to include the new file in https://github.com/openshift/must-gather/blob/main/collection-scripts/gather_windows_node_logs#L11

@wgahnagl create a follow-up task/story for this.

@wgahnagl
wgahnagl marked this pull request as draft August 12, 2026 17:07
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 12, 2026
@jrvaldes jrvaldes changed the title [WINC-2046] Adds log file to windows-exporter WINC-2046: Adds log file to windows-exporter Aug 12, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 12, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 12, 2026 •

Copy link
Copy Markdown

@wgahnagl: This pull request references WINC-2046 which is a valid jira issue.

Details

In response to this:

This allows windows-exporter to use a log file, and use the globally configurable log files.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Comment thread pkg/services/services.go
Comment thread pkg/services/services.go

@jrvaldes jrvaldes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for pushing the commit with tests, PTAL at the comments

Comment thread test/e2e/logs_test.go
Comment thread test/e2e/validation_test.go Outdated
@wgahnagl
wgahnagl force-pushed the WINC-1979 branch 2 times, most recently from 8e17d00 to 42c196d Compare August 18, 2026 18:05
windows-exporter was not ommitting logs to a log file. This creates the
log file and adds a unit test for the logs.
@jrvaldes

Copy link
Copy Markdown
Contributor

/test unit

@jrvaldes

Copy link
Copy Markdown
Contributor

/test lint

@jrvaldes

Copy link
Copy Markdown
Contributor

/test gcp-e2e-operator

@jrvaldes

Copy link
Copy Markdown
Contributor

@coderabbitai full review

@jrvaldes

Copy link
Copy Markdown
Contributor

azure-e2e-upgrade failed with:

=== RUN   TestWMCO/create/Node_Logs/e2e-wm-rflxh/windows_exporter/windows_exporter.log
2026/08/19 16:28:14 unable to retrieve log windows_exporter/windows_exporter.log from node e2e-wm-rflxh: oc adm node-logs failed with exit code exit status 1 and output: : error: the server could not find the requested resource
  404 page not found

which is expected as the log file does not exist in prev version, and we are testing with a newer test suite. I lean towards skipping this test. @mansikulkarni96 WDYT?

@jrvaldes

Copy link
Copy Markdown
Contributor

/override "Red Hat Konflux / windows-machine-config-operator-release-5-0-ec / windows-machine-config-operator-release-5-0"

@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@jrvaldes: Overrode contexts on behalf of jrvaldes: Red Hat Konflux / windows-machine-config-operator-release-5-0-ec / windows-machine-config-operator-release-5-0

Details

In response to this:

/override "Red Hat Konflux / windows-machine-config-operator-release-5-0-ec / windows-machine-config-operator-release-5-0"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jrvaldes

Copy link
Copy Markdown
Contributor

/override ci/prow/gcp-e2e-operator

failure not related, there good CI coverage in other jobs

@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@jrvaldes: Overrode contexts on behalf of jrvaldes: ci/prow/gcp-e2e-operator

Details

In response to this:

/override ci/prow/gcp-e2e-operator

failure not related, there good CI coverage in other jobs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Comment thread test/e2e/logs_test.go
"containerd/containerd.log",
"wicd/windows-instance-config-daemon.exe.INFO",
"csi-proxy/csi-proxy.log",
"windows_exporter/windows_exporter.log",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The azure-e2e-upgrade failure is caused by version skew: the new e2e test code expects windows_exporter/windows_exporter.log, but the upgrade job initially provisions Windows nodes with the previous WMCO version, which does not create that file. the log file is correctly created on fresh installs and after full reconciliation.

@wgahnagl explore the option to skip the windows_exporter.log expectation only in upgrade tests, not the whole Node Logs test. Add a new commit to make the new log check conditional on the node being configured by the current WMCO version, so fresh-install tests continue to enforce it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

consider bringing this back ced41e5#diff-2a3ec15f2cd9038bbb6ad1be37818927fb913fd7a7ebd7cbb29ab41aeac4c3f7R25

`optionalLogs := []string{
    "windows_exporter/windows_exporter.log",
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 2af30b4 and 2 for PR HEAD 9673eac in total

@jrvaldes

Copy link
Copy Markdown
Contributor

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2026
@jrvaldes

Copy link
Copy Markdown
Contributor

/hold

for https://github.com/openshift/windows-machine-config-operator/pull/4355/changes#r3815720824

@wgahnagl please move the PR back to draft, and push the fix for this, then test the azure-e2e-upgrade.

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2026
@wgahnagl

Copy link
Copy Markdown
Contributor Author

/retest-required

@jrvaldes

Copy link
Copy Markdown
Contributor

/hold cancel

@jrvaldes

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2026
@jrvaldes

Copy link
Copy Markdown
Contributor

/override "Red Hat Konflux / windows-machine-config-operator-release-5-0-ec / windows-machine-config-operator-release-5-0"

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@jrvaldes: Overrode contexts on behalf of jrvaldes: Red Hat Konflux / windows-machine-config-operator-release-5-0-ec / windows-machine-config-operator-release-5-0

Details

In response to this:

/override "Red Hat Konflux / windows-machine-config-operator-release-5-0-ec / windows-machine-config-operator-release-5-0"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jrvaldes

Copy link
Copy Markdown
Contributor

/override "ci/prow/vsphere-disconnected-e2e-operator"

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@jrvaldes: Overrode contexts on behalf of jrvaldes: ci/prow/vsphere-disconnected-e2e-operator

Details

In response to this:

/override "ci/prow/vsphere-disconnected-e2e-operator"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@wgahnagl: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/aws-e2e-ote 49d24b1 link false /test aws-e2e-ote

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit caa0b00 into openshift:master Aug 21, 2026
19 of 21 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@jrvaldes: new pull request created: #4507

Details

In response to this:

/cherry-pick release-5.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jrvaldes

Copy link
Copy Markdown
Contributor

/cherry-pick release-4.23

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jrvaldes: new pull request created: #4522

Details

In response to this:

/cherry-pick release-4.23

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants