Skip to content

Conversation

@huntergregory
Copy link
Contributor

@huntergregory huntergregory commented Mar 21, 2023

Reason for Change:
Resolve PATH issue correctly. Removing powershell.exe is back-compat with NPM v1.3.34 (in-prod).

Issue Fixed:

Requirements:

Notes:
Don't want to override PATH variable.

Error

powershell.exe : The term 'powershell.exe' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:27
+ .\setkubeconfigpath.ps1 ; powershell.exe .\npm.exe start --kubeconfig ...
+                           ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (powershell.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

@huntergregory huntergregory added npm Related to NPM. windows labels Mar 21, 2023
@huntergregory huntergregory requested a review from a team as a code owner March 21, 2023 20:11
@huntergregory huntergregory requested review from ck319 and removed request for a team March 21, 2023 20:11
Copy link
Contributor

@vakalapa vakalapa left a comment

Choose a reason for hiding this comment

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

@rbtr @matmerr wdyt ?

value: .\\etc\\azure-npm\\azure-npm.json
- name: PATH
value: '%CONTAINER_SANDBOX_MOUNT_POINT%\Windows\System32\WindowsPowershell\v1.0\'
value: '%CONTAINER_SANDBOX_MOUNT_POINT%\Windows\System32\WindowsPowershell\v1.0\;C:\Windows\System32\'
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if overriding the PATH value here is the right choice, we should append this new PATH to the existing PATH. guess doing it in Dockerfiles is the right way ? or taking in this variable as NEWPATH and appending this NEWPATH to PATH in the Dockerfiles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

appending now, although there might be a better fix that doesn't modify PATH. Looks like there was a regression in the NPM build some time after 02/06

Copy link
Contributor Author

Choose a reason for hiding this comment

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

appending with %PATH% doesn't actually append anything

@huntergregory huntergregory changed the title fix: [WIN-NPM] update PATH so we can use debugging tools via NPM fix: [WIN-NPM] mitigate PATH issue by setting original PATH Mar 23, 2023
@huntergregory huntergregory changed the title fix: [WIN-NPM] mitigate PATH issue by setting original PATH fix: [WIN-NPM] mitigate PATH issue Mar 23, 2023
@huntergregory huntergregory changed the title fix: [WIN-NPM] mitigate PATH issue fix: [WIN-NPM] back-compat mitigation to PATH issue Mar 27, 2023
fieldPath: spec.nodeName
- name: NPM_CONFIG
value: .\\etc\\azure-npm\\azure-npm.json
- name: PATH
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove our first attempt at mitigation, which is not back-compat and is incomplete (can't use vfpctrl and other tools used by HNS to collect logs)

@vakalapa vakalapa merged commit 0c9a726 into master Mar 27, 2023
@vakalapa vakalapa deleted the hgregory/npm-path branch March 27, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Related to NPM. windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants