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/windows case sensitivity #22653

Closed
wants to merge 2 commits into from
Closed

Conversation

ph
Copy link
Contributor

@ph ph commented Nov 18, 2020

Fix uninstall problem on windows with case sensitivity

This PR fix an issue when trying to uninstall the Elastic Agent on
Windows by using a path that doesn't match the system case sensitivity.

This make sure the following are considered to be the same.

  • C:/path-to-agent/elastic-agent uninstall
  • c:/path-to-agent/elastic-agent uninstall

Fixes: #22268

What does this PR do?

Why is it important?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

ph added 2 commits November 18, 2020 09:26
This PR fix an issue when trying to uninstall the Elastic Agent on
Windows by using a path that doesn't match the system case sensitivity.

This make sure the following are considered to be the same.

- C:/path-to-agent/elastic-agent uninstall
- c:/path-to-agent/elastic-agent uninstall

Fixes: #22268
@ph ph added bug review needs_backport PR is waiting to be backported to other branches. Team:Ingest Management labels Nov 18, 2020
@ph ph requested a review from blakerouse November 18, 2020 14:33
@ph ph self-assigned this Nov 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 18, 2020
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #22653 opened]

  • Start Time: 2020-11-18T14:33:48.262+0000

  • Duration: 21 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 1396
Skipped 4
Total 1400

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 1396
Skipped 4
Total 1400

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Have you been able to test this? I think there might be more places where case-sensitivity might be causing issues on Windows.

@@ -58,6 +60,15 @@ func RunningInstalled() bool {
execDir = filepath.Dir(filepath.Dir(execDir))
execPath = filepath.Join(execDir, execName)
}

// Windows filesystem is case insensitive and the following paths are the same.
// - C:\TMP
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can extract this to paths package and compare paths using paths.AreEqual or something similar

@ph
Copy link
Contributor Author

ph commented Nov 23, 2020

@blakerouse I just tested the workflow referenced in the issue, nothing else I can do a bit more of testing.

@gabriellandau
Copy link

I just tested the workflow referenced in the issue

Since this at least fixes the user-reported bug #22268, can we merge it for now and open another issue later if other bugs come up?

@ph ph closed this Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs_backport PR is waiting to be backported to other branches. review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows Agent doesn't uninstall with a lowercase c: drive in the path
5 participants