-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
"oc --config=…" fails when HOME points to inaccessible directory #9581
Comments
I can't reproduce:
and
and
Do you get the same results when you switch to the user and run the command separate instead of as a |
Yes, when the Long story short, the code should not use the default configuration file if a specific file is set using Note that I'm using sudo without
The issue does not occur when
Or another readable directory:
Or a non-existent directory:
An unset
A file isn't good either (not really useful; just for demonstration):
|
Looks like HEAD is happy (my user is deads):
@fabianofranz Not sure if you want to dig back in time. |
@deads2k, you ran it with an unset
Assuming your user can't access
|
Automatic merge from submit-queue don't migrate files you can't access If you can't access a file, you shouldn't try to migrate it. Ref openshift/origin#9581 @fabianofranz
The oc binary still attempts to read a default configuration from
$HOME/.kube/config
even when--config=…
is set. This is problematic whenHOME
points to an inaccessible directory. While this should not be the case, it may still happen, for example, when running commands via sudo where environment variables may not be reset.Version
Steps To Reproduce
~nagios/config.txt
(left as an exercise to the reader)sudo -u nagios oc --config ~nagios/config.txt whoami
Current Result
The reason is that HOME is not set correctly for the nagios user:
Expected Result
The
HOME
environment variable should have no effect if--config
is in use.The text was updated successfully, but these errors were encountered: