Skip to content
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

fix: remove PowerShell from Windows registry interactions #2993

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Conversation

rbtr
Copy link
Contributor

@rbtr rbtr commented Sep 5, 2024

Reason for Change:
PowerShell is heavy (+30mb of memory footprint per invocation). We don't need to use it to interact with the Windows Registry (or ServiceManager) - the Go stdlib has good native bindings that should use instead.

Notes:
This functionality was introduced in #1306. In #2315, it was changed to conditionally set the reg key value only if the HNS path exists. Why? It seems simpler and harmless to always try to set the reg key, so that's what I have done. Unclear if this is problematic - cc @ZetaoZhuang

Supersedes and closes #2974 and #2961 (and #2949)

@rbtr rbtr requested review from a team as code owners September 5, 2024 21:45
@rbtr rbtr added cns Related to CNS. fix Fixes something. release/latest Change affects latest release train needs-backport Change needs to be backported to previous release trains labels Sep 5, 2024
@rbtr rbtr self-assigned this Sep 5, 2024
@rbtr rbtr force-pushed the fix/depwsh branch 5 times, most recently from 6cf43ba to 3496998 Compare September 6, 2024 16:23
@rbtr rbtr enabled auto-merge September 6, 2024 17:03
@rbtr rbtr disabled auto-merge September 6, 2024 17:03
@ZetaoZhuang
Copy link
Contributor

In #2315, it was changed to conditionally because there was a livesite that our customer got error during the cns start up to set SdnRemoteArpMacAddress. somehow hns was not enabled on their machines so we need to skip this for them.

@rbtr
Copy link
Contributor Author

rbtr commented Sep 6, 2024

@ZetaoZhuang is it okay to try to set it? Or can we not even try to set it if HNS is not enabled?

@ZetaoZhuang
Copy link
Contributor

@ZetaoZhuang is it okay to try to set it? Or can we not even try to set it if HNS is not enabled?

from that livesite, if we set it when hns is not enabled, we will get error complaining about something like "hns state path does not exist" or so. that is the reason why we made it conditional. I believe we could set it if it does not complain anymore.

platform/os_windows.go Outdated Show resolved Hide resolved
ZetaoZhuang
ZetaoZhuang previously approved these changes Sep 12, 2024
Copy link
Contributor

@ZetaoZhuang ZetaoZhuang left a comment

Choose a reason for hiding this comment

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

lgtm

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 8, 2024
@rbtr rbtr added this pull request to the merge queue Nov 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 12, 2024
@rbtr rbtr dismissed stale reviews from nairashu and rjdenney via 17a73a3 November 12, 2024 23:36
@rbtr rbtr force-pushed the fix/depwsh branch 3 times, most recently from 9b9d321 to f1f6c51 Compare November 12, 2024 23:59
@rbtr
Copy link
Contributor Author

rbtr commented Nov 13, 2024

/azp run Azure Container Networking PR

@rbtr rbtr enabled auto-merge November 13, 2024 16:46
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@rjdenney rjdenney left a comment

Choose a reason for hiding this comment

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

lgtm

@rbtr rbtr disabled auto-merge November 13, 2024 21:21
@rbtr rbtr added this pull request to the merge queue Nov 13, 2024
Merged via the queue into master with commit c3f1a6e Nov 14, 2024
14 checks passed
@rbtr rbtr deleted the fix/depwsh branch November 14, 2024 00:07
rbtr added a commit that referenced this pull request Nov 22, 2024
remove powershell from windows registry txs

Signed-off-by: Evan Baker <[email protected]>
rbtr added a commit that referenced this pull request Nov 22, 2024
remove powershell from windows registry txs

Signed-off-by: Evan Baker <[email protected]>
rbtr added a commit that referenced this pull request Nov 22, 2024
remove powershell from windows registry txs

Signed-off-by: Evan Baker <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Nov 27, 2024
)

remove powershell from windows registry txs

Signed-off-by: Evan Baker <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Nov 27, 2024
)

remove powershell from windows registry txs

Signed-off-by: Evan Baker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cns Related to CNS. fix Fixes something. needs-backport Change needs to be backported to previous release trains release/latest Change affects latest release train
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants