Skip to content

Commit 5b83c0a

Browse files
lakshk98matmerrkumarvin123matthewigeanubhabMajumdar
authored
Laksh/rebase main (#92)
* add CI for windows dev branch * ci: rename images workflow (microsoft#1627) # Description Having this action be named as image is confusing since it does Image + E2E ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * feat(ebpfwindows-Plugin): ebpf Windows Plugin using a custom parser (microsoft#1633) # Description This PR adds a new Retina Plugin to read Metrics Map events from Windows eBPF ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * ci: windows image workqueue dispatch (microsoft#1670) # Description Generate images and manifests for windows dev branch ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * update retinaebpfapi version (microsoft#1683) # Description Pulling in latest retinaepfapi package from nuget.org. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed NA ## Additional Notes NA --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * ci: update ci for dev/v0.0.33-windows (microsoft#1687) # Description Update dev/v0.0.33 branch to push images alongside main ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Added handling for CiliumOnWindows Registry Values in Hns and EbpfWin… (microsoft#1684) # Description Added registry check for CiliumOnWindows in Hns and EbpfWindows plugins to support CoExistence in Mixed Mode clusters Please provide a brief description of the changes made in this pull request. Added a common function to check for the Registry value. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. I have manually deployed the image on AKS cluster with --set enabledPlugin_win="[ebpfwindows\,hnsstats\]" ` and verified through logs either ebpfwindows or hnsttats are running based on CiliumOnWindows Registry value - [x] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * (test): Retina Windows eBPF e2e Tests (microsoft#1721) # Description Added e2e tests for Windows ebpf scenario. Please provide a brief description of the changes made in this pull request. 1. Creates a daemon set to install ebpf on windows nodes 2. Installs a test ebpf program which generates the events 3. The generated events are verified by the test jobs ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed successful run with this change https://github.com/kumarvin123/retina/actions/runs/15951308276 Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Consume latest RetinaEbpfApi; Add lost events API; Update struct processing due to latest RetinaEbpfApi changes (microsoft#1768) # Description - Updates RetinaEbpfApi version - Updates processing of Metrics Map due to API changes - Adds processing for lost events API - Updates tests to utilize added windows_metrics map ## Related Issue ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Matthew Ige <matthewige1@gmail.com> Co-authored-by: Vinod K L Swamy <vinodko@microsoft.com> * Update e2e-test-event-writer yml to trigger on dev branch (microsoft#1782) # Description e2e-test-event-writer.yml was not triggering on dev branches ## Related Issue n/a ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed n/a ## Additional Notes n/a --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Cherry picking locactx fix form main branch (microsoft#1810) Cherry picking following fix from main branch: fix(localctx+win): Fix the helm insatll command for localCtx (microsoft#1807) # Description - Disable operator installation for `localCtx` (not needed) - Windows configmap is missing `enableAnnotations` config ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. Signed-off-by: Anubhab Majumdar <anmajumdar@microsoft.com> Co-authored-by: Anubhab Majumdar <anmajumdar@microsoft.com> * fix enable annotation (microsoft#1818) # Description enableAnnotations got defined twice in windows configmap due to [this pr](microsoft#1810). Removed extra occurrence of enableAnnotations. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * [SFI - Service Tags] Retina Virtual Tags (microsoft#1819) # Description Run E2e Tests pipeline is failing during cluster creation with the following error: ```bash #################### CreateNPMCluster ################################################################### 2025/08/14 18:58:11 when the cluster is ready, use the below command to access and debug 2025/08/14 18:58:11 az aks get-credentials --resource-group runner-e2e-netobs-1755197881 --name runner-e2e-netobs-1755197881 --subscription *** 2025/08/14 18:58:11 creating cluster "runner-e2e-netobs-1755197881" in resource group "runner-e2e-netobs-1755197881"... 2025/08/14 18:58:40 failed to create cluster: GET https://management.azure.com/subscriptions/***/providers/Microsoft.ContainerService/locations/eastus2/operations/fd882d18-319b-4200-aa9e-a2934886e35b -------------------------------------------------------------------------------- RESPONSE 200: 200 OK ERROR CODE: RequestDisallowedByPolicy -------------------------------------------------------------------------------- { "name": "fd882d18-319b-4200-aa9e-a2934886e35b", "status": "Failed", "startTime": "2025-08-14T18:58:30.3284728Z", "endTime": "2025-08-14T18:58:38.5566866Z", "error": { "code": "RequestDisallowedByPolicy", "message": "Create or update public IP failed: Subscription: ***; resource group: MC_runner-e2e-netobs-1755197881_runner-e2e-netobs-1755197881_eastus2; public IP name: c1debc4c-7910-4441-b0ce-30b64f37b43c. Resource 'c1debc4c-7910-4441-b0ce-30b64f37b43c' was disallowed by policy. Reasons: 'The public ip needs to be tagged with either a service or virtual tag.'. See error details for policy resource IDs.", "details": [ { "code": "RequestDisallowedByPolicy", "message": "Resource 'c1debc4c-7910-4441-b0ce-30b64f37b43c' was disallowed by policy. Reasons: 'The public ip needs to be tagged with either a service or virtual tag.'. See error details for policy resource IDs.", "target": "c1debc4c-7910-4441-b0ce-30b64f37b43c" } ] } } -------------------------------------------------------------------------------- runner.go:38: Error Trace: /home/runner/work/retina/retina/test/e2e/framework/types/runner.go:38 /home/runner/work/retina/retina/test/e2e/infra/azure_temp_infra_setup.go:47 /home/runner/work/retina/retina/test/e2e/retina_e2e_test.go:38 Error: Received unexpected error: did not expect error from step CreateNPMCluster but got error: received notification, failed to create cluster: GET https://management.azure.com/subscriptions/***/providers/Microsoft.ContainerService/locations/eastus2/operations/fd882d18-319b-4200-aa9e-a2934886e35b -------------------------------------------------------------------------------- RESPONSE 200: 200 OK ERROR CODE: RequestDisallowedByPolicy -------------------------------------------------------------------------------- { "name": "fd882d18-319b-4200-aa9e-a2934886e35b", "status": "Failed", "startTime": "2025-08-14T18:58:30.3284728Z", "endTime": "2025-08-14T18:58:38.5566866Z", "error": { "code": "RequestDisallowedByPolicy", "message": "Create or update public IP failed: Subscription: ***; resource group: MC_runner-e2e-netobs-1755197881_runner-e2e-netobs-1755197881_eastus2; public IP name: c1debc4c-7910-4441-b0ce-30b64f37b43c. Resource 'c1debc4c-7910-4441-b0ce-30b64f37b43c' was disallowed by policy. Reasons: 'The public ip needs to be tagged with either a service or virtual tag.'. See error details for policy resource IDs.", "details": [ { "code": "RequestDisallowedByPolicy", "message": "Resource 'c1debc4c-7910-4441-b0ce-30b64f37b43c' was disallowed by policy. Reasons: 'The public ip needs to be tagged with either a service or virtual tag.'. See error details for policy resource IDs.", "target": "c1debc4c-7910-4441-b0ce-30b64f37b43c" } ] } } -------------------------------------------------------------------------------- ``` Cherry-picked changes from this [draft pr](https://github.com/microsoft/retina/pull/1796/files) which adds a public IP address with the required tags to the load balancer. This should fix the above issue. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. Co-authored-by: Keerthana Routhu <krouthu@microsoft.com> * Revert sfi changes (microsoft#1840) # Description The SFI related changes introduced in the pr microsoft#1819 causes failure in e2e runs. This pr reverts those changes. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Merging PR from main- refactor: add dockerfile for windows build and make build-binaries microsoft#1720 (microsoft#1842) # Description Merging PR from main- refactor: add dockerfile for windows build and make build-binaries microsoft#1720 We want to separate the windows build into 2 steps Build the binaries needed for the final image Build the final image including the binaries built in step 1 For step 1, add a build-binaries task to the Makefile that builds the binaries needed for the final image. For step 2, add a Dockerfile for the windows build that builds the final image including the binaries built in step 1 ## Related Issue Make window's build branch compatible with release pipeline Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Add pktmon parsing (microsoft#1875) # Description This pull request adds support for parsing and handling "Pktmon Drop" events in the Windows eBPF datapath plugin. It introduces new structures and logic to decode these events, integrates them into the event handling and parsing pipeline, and adds tests to ensure correct processing. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Update windows base image (microsoft#1883) --------- # Description Updated Docker file to pull latest windows base image to resolve security vulnerabilities. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * fix(pipeline): Add space character to create fresh commit hash (microsoft#1911) # Description Please provide a brief description of the changes made in this pull request. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Return error when ip is nil (microsoft#1908) # Description Retina pods crash when a nil ip is passed to the enricher. Returning error in handleTraceEvent so that nil ip is not sent to enricher. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * latest windows base image (microsoft#1931) # Description Updated Docker file to pull latest windows base image to resolve security vulnerabilities. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [X] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * chore: update dockerfile for shell in Windows CI (microsoft#1932) # Description This action is failing regularly on `dev/v0.0.33-windows` https://github.com/microsoft/retina/actions/runs/19348996959/job/55361017859 ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * fix windows build timeout (microsoft#1935) # Description Please provide a brief description of the changes made in this pull request. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Mathew Merrick <matmerr@users.noreply.github.com> * latest windows base image (01/13/26) (microsoft#1998) # Description New windows base images were published on 1/13. Updated Docker file to pull latest windows base image to resolve security vulnerabilities. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [x] I have updated the documentation, if necessary. - [x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Gracefully Handle the abscence of retinaebpfapi.dll (microsoft#2143) # Description This change makes the Windows eBPF plugin fail open when retinaebpfapi.dll is not installed or does not expose the expected entrypoints. Instead of deferring the failure until the first native call, startup now validates the DLL up front, logs a warning, and skips plugin initialization cleanly. It also adds a unit test covering the missing-DLL path. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ x] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [x ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x ] I have correctly attributed the author(s) of the code. - [x ] I have tested the changes locally. - [x ] I have followed the project's style guidelines. - [x ] I have updated the documentation, if necessary. - [ x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * ebpf xdp version bump (microsoft#2267) # Description Remove retinaebpfapi.dll from retina image. Bumped the version of following: ebpf 0.21.0 -> 1.1.0 xdp 1.1.0 -> 1.3.0 Microsoft.Wcn.Observability.eBPF.Retina (retinaebpfapi.dll) 0.1.0-prerelease.11 -> 1.3.0 servercore base images ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Fix xdp install in retina test (microsoft#2283) # Description Made the following fixes to the install-ebpf-xdp.ps1 script which is used to setup node for e2e tests. - Add xdp cert to cert store to resolve installation errors. - Download and install retinaebpfapi on the node since it is no longer packaged with retina image - Install vc++ runtime needed for retinaebpfapi.dll - Copy ebpfapi.dll to the dir where retinaebpfapi.dll is (this can be updated when retinaebpfapi can find the dll from path) ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * Bump retinaebpfapi version (microsoft#2358) # Description Consuming latest available retinaebpfapi version and windows base images. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. * ci: remove krew-index update step on dev/v0.0.33-windows (microsoft#2390) The krew-release-bot step in goreleaser.yaml triggers on every tag pushed from this branch, including pre-release tags like `v0.0.33-windows-rc.2`, opening spurious PRs against [krew-index](https://github.com/kubernetes-sigs/krew-index) (e.g. #5787). Main has microsoft#2107 which gates the step on final release tags, but this dev branch forked before that landed. Since this branch only produces pre-release/windows-dev tags that should never publish to krew, removing the step entirely is the simplest fix. The new tag `v0.0.33-windows-rc.2` already points to a commit with this change applied, so the in-flight release is unaffected. --------- Signed-off-by: Mathew Merrick <matmerr@microsoft.com> * Laksh/cherry pick specific (microsoft#2425) # Description Problem The OB pipeline for tag v0.0.33-windows-rc.2 fails with two errors: 1. kubectl_shell: docker build fails because target shell-target not found in cli/Dockerfile 2. agent_win: output/windows_amd64/*.exe not found Root cause: branch dev/v0.0.33-windows was created from commit 82d621c (May 7, 2025) and is missing upstream changes that restructured the Windows build pipeline. Cherry-picked following commits to resolve the issue: [59c1655](microsoft@59c1655) (1946) and [fd482c0](microsoft@fd482c0) (microsoft#1997) ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Kamil <kamil.prz@gmail.com> Signed-off-by: Laksh Kotian <lakshkotian98@gmail.com> Co-authored-by: carlotaarvela <67275927+carlotaarvela@users.noreply.github.com> Co-authored-by: Kamil <kamil.prz@gmail.com> Co-authored-by: kamilprz <36544756+kamilprz@users.noreply.github.com> Co-authored-by: Simone Rodigari <32323373+SRodi@users.noreply.github.com> * Bump Go toolchain and dependencies to resolve security vulnerabilities (microsoft#2538) # Description Problem The `retina-agent` image built from `dev/v0.0.33-windows` is flagged by container image vulnerability scanning known Go CVEs (`stdlib` plus modules such as `containerd`, `grpc`, `golang.org/x/net`, `mapstructure/v2`, `runc` and `aws-sdk-go-v2`) Since branch `dev/v0.0.33-windows` was created from commit `82d621c` (May 2025, ~500 commits behind), so Go toolchain/dependencies are frozen. `main` is already patched, so we are fixing staleness. Aligned the branch's Go toolchain and dependencies with the patched versions `main` already uses: - Go builder `mcr.microsoft.com/oss/go/microsoft/golang` `1.24.x -> 1.26.5` across the controller/operator/cli/test Dockerfiles (Linux `azurelinux3.0`, Windows `windowsservercore-ltsc2022`; operator-windows moves `cbl-mariner2.0 -> azurelinux3.0` since there's no 1.26 Mariner tag). Building with 1.26.5 clears the `stdlib` advisories (the scanner reads the Go version baked into the binary). - `go` directive `1.24.3 -> 1.26.0`. - `mapstructure/v2 -> 2.5.0`, `containerd -> 1.7.33`, `runc -> 1.2.8` + `selinux -> 1.13.1`, `grpc -> 1.79.3`, `golang.org/x/net -> 0.57.0`, `aws-sdk-go-v2/.../eventstream -> 1.7.14`, `docker/docker -> 28.5.2`. **note** left out cilium, inspektor-gadget, and docker as their patched versions dropped/moved the exact packages we import (or the fix lives in a totally different module), so bumping them breaks the build and needs the code refactors main  already did (everything else was a clean version bump) ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Christelle Chatelain <cchatelain@microsoft.com> Signed-off-by: chrcha1 <97578958+chrcha1@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Align rebased history with squash goal state Discard superseded upstream cherry-picks and intermediate Windows branch changes so the expanded history produces the same final tree as laksh/squash-and-rebase. * resolve comments --------- Signed-off-by: Matthew Ige <matthewige1@gmail.com> Signed-off-by: Anubhab Majumdar <anmajumdar@microsoft.com> Signed-off-by: Mathew Merrick <matmerr@users.noreply.github.com> Signed-off-by: Mathew Merrick <matmerr@microsoft.com> Signed-off-by: Kamil <kamil.prz@gmail.com> Signed-off-by: Laksh Kotian <lakshkotian98@gmail.com> Signed-off-by: Christelle Chatelain <cchatelain@microsoft.com> Signed-off-by: chrcha1 <97578958+chrcha1@users.noreply.github.com> Co-authored-by: Mathew Merrick <matmerr@microsoft.com> Co-authored-by: Mathew Merrick <matmerr@users.noreply.github.com> Co-authored-by: VINOD KLSWAMY <50496432+kumarvin123@users.noreply.github.com> Co-authored-by: Matthew Ige <matthewige1@gmail.com> Co-authored-by: Vinod K L Swamy <vinodko@microsoft.com> Co-authored-by: Anubhab Majumdar <anmajumdar@microsoft.com> Co-authored-by: Keerthana Routhu <krouthu@microsoft.com> Co-authored-by: Iti Agrawal <agrawaliti0107@gmail.com> Co-authored-by: Beegii Khurelsukh <72892628+BeegiiK@users.noreply.github.com> Co-authored-by: carlotaarvela <67275927+carlotaarvela@users.noreply.github.com> Co-authored-by: Kamil <kamil.prz@gmail.com> Co-authored-by: kamilprz <36544756+kamilprz@users.noreply.github.com> Co-authored-by: Simone Rodigari <32323373+SRodi@users.noreply.github.com> Co-authored-by: Christelle Chatelain <97578958+chrcha1@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 20e0aa5 commit 5b83c0a

41 files changed

Lines changed: 9274 additions & 2453 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e-test-event-writer.yml

Lines changed: 116 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
name: Build E2E Test Event Writer
22
on:
3+
pull_request:
34
push:
4-
branches:
5+
branches:
56
- main
6-
- dev/**
7+
- "dev/**"
78
merge_group:
89
types: [checks_requested]
910
workflow_dispatch:
1011

12+
1113
permissions:
1214
contents: read
1315
id-token: write
1416
packages: write
1517

1618
env:
1719
EVENT_WRITER_PATH: "${{ github.workspace }}/test/e2e/tools/event-writer/"
20+
EBPF_VERSION: "1.1.0"
21+
XDP_SDK_VERSION: "1.3.0"
1822

1923
jobs:
2024
retina-win-e2e-bpf-images:
2125
name: Build E2E Test Event Writer
2226
runs-on: windows-2022
23-
timeout-minutes: 30
2427

2528
env:
2629
IS_MERGE_GROUP: ${{ (github.event_name == 'merge_group') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev/v0.0.33-windows' && github.repository == 'microsoft/retina') }}
@@ -33,3 +36,113 @@ jobs:
3336
steps:
3437
- name: Checkout code
3538
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
39+
40+
- name: Azure Login
41+
uses: azure/login@f5d393ae46f8fde4be8b75f32e3fc50e654ad0ca # v3.0.1
42+
if: ${{ env.IS_MERGE_GROUP == 'true' }}
43+
with:
44+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
45+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
46+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION }}
47+
48+
- name: Ensure Docker daemon is running
49+
shell: pwsh
50+
run: |
51+
$timeout = 120
52+
$timer = [Diagnostics.Stopwatch]::StartNew()
53+
while ($timer.Elapsed.TotalSeconds -lt $timeout) {
54+
$svc = Get-Service docker -ErrorAction SilentlyContinue
55+
if ($svc -and $svc.Status -ne 'Running') {
56+
Start-Service docker -ErrorAction SilentlyContinue
57+
}
58+
$result = docker info 2>&1
59+
if ($LASTEXITCODE -eq 0) {
60+
Write-Host "Docker daemon is ready"
61+
return
62+
}
63+
Write-Host "Waiting for Docker daemon to start..."
64+
Start-Sleep -Seconds 5
65+
}
66+
throw "Docker daemon failed to start within $timeout seconds"
67+
68+
- name: Docker Login to ACR
69+
if: ${{ env.IS_MERGE_GROUP == 'true' }}
70+
shell: pwsh
71+
run: az acr login --name "${{ vars.ACR_NAME }}"
72+
73+
- name: Docker Login to ghcr.io
74+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
75+
if: ${{ env.IS_MERGE_GROUP != 'true' }}
76+
with:
77+
registry: ghcr.io
78+
username: ${{ github.actor }}
79+
password: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Set MSBuild path
82+
run: |
83+
echo "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
84+
85+
- name: Install LLVM 18.1.8
86+
shell: pwsh
87+
run: |
88+
# Install LLVM 18.1.8 to ensure consistent version across runners
89+
try {
90+
choco install llvm --version=18.1.8 --allow-downgrade -y --force
91+
# Add installed LLVM to PATH first so it takes precedence
92+
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
93+
Write-Host "Successfully installed LLVM 18.1.8"
94+
} catch {
95+
Write-Warning "Failed to install LLVM 18.1.8 via chocolatey: $($_.Exception.Message)"
96+
Write-Host "Continuing with pre-installed LLVM version"
97+
}
98+
99+
- name: Nuget Restore
100+
shell: cmd
101+
run: |
102+
nuget restore .\event_writer.sln
103+
working-directory: ${{ env.EVENT_WRITER_PATH }}
104+
105+
- name: Configure eBPF store
106+
shell: cmd
107+
run: |
108+
.\export_program_info.exe --clear
109+
.\export_program_info.exe
110+
working-directory: ${{ env.EVENT_WRITER_PATH }}\packages\eBPF-for-Windows.x64.${{ env.EBPF_VERSION }}\build\native\bin
111+
112+
- name: Build Event-Writer
113+
shell: cmd
114+
run: |
115+
msbuild /m /t:Clean /p:Configuration=Release /p:Platform=x64 /restore event_writer.sln
116+
msbuild /m /p:Configuration=Release /p:Platform=x64 /restore /v:detailed event_writer.sln
117+
working-directory: ${{ env.EVENT_WRITER_PATH }}
118+
119+
- name: Determine Docker tag
120+
id: tag
121+
shell: pwsh
122+
run: |
123+
$TAG = $(git tag --points-at HEAD)
124+
if (-not $TAG) {
125+
$TAG = $(git rev-parse --short HEAD)
126+
}
127+
echo "tag=$TAG" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
128+
129+
- name: Build and push images
130+
shell: pwsh
131+
working-directory: ${{ env.EVENT_WRITER_PATH }}
132+
run: |
133+
$isMergeGroup = "${{ env.IS_MERGE_GROUP }}" -eq "true"
134+
if (-not $isMergeGroup) {
135+
$image = "ghcr.io/${{ github.repository }}/test/e2e-test-event-writer".ToLower()
136+
} else {
137+
$image = "${{ vars.ACR_NAME }}/${{ github.repository }}/test/e2e-test-event-writer".ToLower()
138+
}
139+
140+
$tag = "${{ steps.tag.outputs.tag }}"
141+
docker build -f "./Dockerfile" -t "${image}:${tag}" -t "${image}:latest" .
142+
143+
if ("${{ github.event_name }}" -ne "pull_request") {
144+
docker push "${image}:${tag}"
145+
docker push "${image}:latest"
146+
} else {
147+
Write-Host "Skipping image push for pull_request runs"
148+
}

deploy/standard/manifests/controller/helm/retina/templates/configmap.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@ data:
5353
metricsInterval: {{ .Values.metricsInterval }}
5454
metricsIntervalDuration: {{ .Values.metricsIntervalDuration }}
5555
enableTelemetry: {{ .Values.enableTelemetry }}
56-
enablePodLevel: {{ .Values.enablePodLevel }}
56+
enablePodLevel: {{ .Values.enablePodLevelWin }}
5757
remoteContext: {{ .Values.remoteContext }}
5858
enableAnnotations: {{ .Values.enableAnnotations }}
5959
telemetryInterval: {{ .Values.daemonset.telemetryInterval }}
6060
{{- end}}
61-
62-
63-

deploy/standard/manifests/controller/helm/retina/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ image:
5353
enableConntrackMetrics: false
5454
conntrackReportInterval: 30s
5555
enablePodLevel: false
56+
enablePodLevelWin: true
5657
remoteContext: false
5758
enableAnnotations: false
5859
bypassLookupIPOfInterest: false
@@ -96,7 +97,7 @@ apiServer:
9697
logLevel: debug
9798

9899
enabledPlugin_linux: '["dropreason","packetforward","linuxutil","dns"]'
99-
enabledPlugin_win: '["hnsstats"]'
100+
enabledPlugin_win: '["hnsstats", "ebpfwindows"]'
100101

101102
enableTelemetry: false
102103

@@ -312,7 +313,7 @@ metrics:
312313
tlsConfig: {}
313314
## @param metrics.serviceMonitor.relabelings [array] Prometheus relabeling rules to apply to samples before scraping
314315
##
315-
relabelings:
316+
relabelings:
316317
- sourceLabels:
317318
[__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
318319
separator: ":"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
// package common contains common functions and types used by all Retina Windows plugins.
5+
package common
6+
7+
import (
8+
"errors"
9+
"fmt"
10+
11+
"golang.org/x/sys/windows/registry"
12+
)
13+
14+
const (
15+
// KeyPath is the registry key path where the CiliumOnWindows value is stored.
16+
// This key is used to determine if Cilium is enabled on Windows.
17+
KeyPath = `SYSTEM\CurrentControlSet\Services\hns\State`
18+
// CiliumOnWindows is the registry value name that indicates if Cilium is enabled on Windows.
19+
// If this value is set to 1, Cilium is enabled on Windows. If this value is not set or set to 0, Cilium is not enabled.
20+
ValueName = "CiliumOnWindows"
21+
)
22+
23+
// IsCiliumOnWindowsEnabled checks if the CiliumOnWindows registry value is set to 1.
24+
// Returns (true, nil) if set to 1, (false, nil) if not set or not exist, (false, err) for other errors.
25+
func IsCiliumOnWindowsEnabled() (bool, error) {
26+
k, err := registry.OpenKey(registry.LOCAL_MACHINE, KeyPath, registry.QUERY_VALUE)
27+
if err != nil {
28+
if errors.Is(err, registry.ErrNotExist) {
29+
return false, nil
30+
}
31+
return false, fmt.Errorf("opening registry key: %w", err)
32+
}
33+
defer k.Close()
34+
35+
val, _, err := k.GetIntegerValue(ValueName)
36+
if err != nil {
37+
if errors.Is(err, registry.ErrNotExist) {
38+
return false, nil
39+
}
40+
return false, fmt.Errorf("reading registry value: %w", err)
41+
}
42+
return val == 1, nil
43+
}

0 commit comments

Comments
 (0)