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

Changing the shell directory didn’t work as expected #13

Open
blues-man opened this issue Nov 12, 2021 · 5 comments
Open

Changing the shell directory didn’t work as expected #13

blues-man opened this issue Nov 12, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@blues-man
Copy link
Collaborator

The CLI starts with root users on /, it should start to /root as $HOME

Either using cd /root in .bashrc or .bash_profile didn't worked, neither config.yml since this is a nested VM.

@blues-man blues-man added the bug Something isn't working label Nov 12, 2021
@blues-man blues-man added this to the Instruqt migration: Phase I milestone Nov 12, 2021
@amochtar
Copy link

Not sure how it being a nested VM is related, but it seems $HOME is not set somehow:

[root@crc-dzk9v-master-0 /]# cd
bash: cd: HOME not set

When I add these lines to /root/.bashrc, I do start in /root:

export HOME=/root
cd $HOME

@blues-man
Copy link
Collaborator Author

Hi @amochtar , the issue is that when you start the track, the $HOME directory is not set. If you do su - root then it is set.

I tried to append in the setup script the export + cd in the bash_profile, but the terminal starts always in / and $HOME is not set

@amochtar
Copy link

Yes, but $HOME is not something we explicitly set or unset. The OS should set that, as it's part of the POSIX standard. Could it be some glitch in the crc image?

@yuriolisa
Copy link
Contributor

Hi, @blues-man,

I just found an issue on scenario 2 of Operator SDK with Go, in which the root cause is the $HOME is not set.

go: downloading golang.org/x/mod v0.2.0 build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined make: *** [Makefile:126: controller-gen] Error 1 Error: failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2

Could you please let me know if I should open a new issue or keep it as a comment here?

@blues-man
Copy link
Collaborator Author

That happens when the context is not loaded, it is not clear why CoreOS (Nested VM) starts in this way, and we cannot inject the setting from the Host VM.

As a workaround I added in that track the command su - root but now we are also working on sidecar container based tracks like this:
https://github.com/openshift-instruqt/instruqt/blob/master/operatorframework/test/operatorframework-go-operator-podset-sidecar/config.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants