Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Fail install if sudo access fails #3260

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

stmcginnis
Copy link
Contributor

What this PR does / why we need it

If someone installing TCE either does not have sudo access, or enters
the wrong password, it is currently ignored and the script continues on
but does not actually complete the install.

This adds a check on the sudo attempt to make sure it is successful. If
not, it gives an error and exits will a failure return code.

Details for the Release Notes (PLEASE PROVIDE)

Install on Linux and MacOS will now return error if attempt to sudo fails.

Which issue(s) this PR fixes

Fixes: #1647

Describe testing done for PR

Local test scripts to attempt to sudo and verify exit code if unable to do so.

Special notes for your reviewer

If someone installing TCE either does not have sudo access, or enters
the wrong password, it is currently ignored and the script continues on
but does not actually complete the install.

This adds a check on the sudo attempt to make sure it is successful. If
not, it gives an error and exits will a failure return code.

Signed-off-by: Sean McGinnis <smcginnis@vmware.com>
@stmcginnis stmcginnis requested a review from a team as a code owner February 24, 2022 23:06
@github-actions github-actions bot added the owner/release-eng Work executed by VMware release engineering team label Feb 24, 2022
Copy link
Contributor

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

Nice! 👍🏼

@dvonthenen dvonthenen merged commit 586fe44 into vmware-tanzu:main Feb 25, 2022
@stmcginnis stmcginnis deleted the no-sudo-install branch February 27, 2022 19:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-not-required owner/release-eng Work executed by VMware release engineering team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The install.sh script fails if user doesn't have sudo access.
4 participants