This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
The install.sh script fails if user doesn't have sudo access. #1647
Labels
good-first-issue
Good for newcomers
help-wanted
Looking for contributors to help
kind/enhancement
An enhancement to an existing capability
kind/feature
A request for a new feature
owner/core-eng
Work executed by TCE's core engineering team
Milestone
Bug Report
If a user does not have
sudo
access orsudo
is prohibited in some way, theinstall.sh
script will fail when run, but in failing it doesn't actually detect the failure and tries to keep running.Further, the documentation does not seem to warn you of the following:
sudo
access to run theinstall.sh
script or it will not work.install.sh
script by default cannot be run directly asroot
and that you need to setALLOW_INSTALL_AS_ROOT
environment variable to install asroot
.root
, there is no mention of nonroot
users needing to install plugins in their own user environment using a separate step.sudo
access you can still run theinstall.sh
script as a normal user by creating$HOME/bin
directory.$HOME/bin
and installing as a normal user, that you will also need to add that directory to yourPATH
so thetanzu
command is found.Expected Behavior
The documentation should better explain the options/requirements for running the
install.sh
script.The
install.sh
script should properly detect whensudo
fails and generate a decent error message explaining how you can install it into$HOME/bin
instead.Steps to Reproduce the Bug
On a system where the user does not have
sudo
access run:Doing this in a docker container is a good option for doing this and actually highlights why the current behaviour is bad as it causes failures if someone tries use it from a
Dockerfile
. First they will find it fails to run when run asroot
as they will not know about the special environment variable, but then as nonroot
user it will fail due to lack ofsudo
access.When the script is run as normal user without
sudo
access, the script fails with:Note how the
sudo
failed:but the script kept running, resulting in later steps also failing as
tanzu
command couldn't be found.Environment Details
tanzu version
): tce-linux-amd64-v0.8.0-rc.1cc @jorgemoralespou
The text was updated successfully, but these errors were encountered: