projectatomic / adb-tests

placeholder for tests for the adb while its long term place to live is sorted out
GNU General Public License v2.0
7 stars 19 forks source link

Adds user and sudo_user variables in order to detect kube/config #32

Closed cdrage closed 8 years ago

cdrage commented 8 years ago

This commit adds environment variables to the Makefile in order to explicit determine that the user that is running the file is indeed root.

The reasoning behind is that atomicapp now detects what user 'sudo' is running on.

If 'sudo atomic run foo' is ran, it detects the user. However, because this script is being ran as root/sudo, the .kube/config file is located at /root/.kube/config and thus SUDO_USER and USER env variables need to be explicitly implied.

Within the providers/kubernetes.sh file, kubectl config commands are added in order to generate the .kube/config file.

cdrage commented 8 years ago

This commit also adds 'kubectl set-config' commands in order to get the k8s tests working on centos-ci ping @dustymabe

cdrage commented 8 years ago

Hey @surajssd @containscafeine @dustymabe @kadel

Can any of you please review / check this is okay for merge for the Atomic App tests?

cdrage commented 8 years ago

Timeout... pinging again! @surajssd @containscafeine @dustymabe @kadel

kadel commented 8 years ago

Sorry, I saw this earlier, but forget to comment it :(

LGTM

kadel commented 8 years ago

Maybe one thing: Is this necessary kubectl config set-credentials default --token=foobar?

dustymabe commented 8 years ago

From your commit message:

If 'sudo atomic run foo' is ran, it detects the user. However, because this script is being ran as root/sudo, the .kube/config file is located at /root/.kube/config and thus SUDO_USER and USER env variables need to be explicitly implied.

I would argue that this is a bug in atomicapp - we should detect where the user's home is and not hard code /home/ probably.

cdrage commented 8 years ago

I will agree with @dustymabe , I think this is me being lazy in regards to the testing scenarios. We should be testing against having no .kube/config anyways as that's how it is by default on most beginner installations. Closing this PR.