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

Set default home value #281

Merged
merged 3 commits into from
Aug 10, 2018
Merged

Conversation

priyawadhwa
Copy link
Collaborator

@priyawadhwa priyawadhwa commented Aug 8, 2018

Based on this documentation it looks like the default value of home is set based on the user.

From some experimentation it looks like if the USER is root we set the default value to /root, and if USER is set then the default value of HOME is /home/${user}

Should fix #280

@priyawadhwa priyawadhwa force-pushed the home branch 3 times, most recently from 47052ee to 0886079 Compare August 8, 2018 17:32
for _, env := range envs {
split := strings.SplitN(env, "=", 2)
if split[0] == constants.HOME {
return envs
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like it can only set the default HOME, as designed. Maybe rename the function, or refactor it to support more default values in the future?

@dlorenc
Copy link
Collaborator

dlorenc commented Aug 10, 2018

missed a spot:

# github.com/GoogleContainerTools/kaniko/pkg/commands
pkg/commands/run_test.go:68:14: undefined: addDefaultEnvs

@priyawadhwa priyawadhwa merged commit 4e77fa0 into GoogleContainerTools:master Aug 10, 2018
@priyawadhwa priyawadhwa deleted the home branch August 10, 2018 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set default value of HOME to /root
2 participants