Skip to content

Add variable for the guest home directory #1736

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

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

afbjorklund
Copy link
Member

Just a refactoring, to avoid hardcoding /home and linux everywhere in cidata.

@@ -151,6 +151,7 @@ The volume label is "cidata", as defined by [cloud-init NoCloud](https://cloudin
- `LIMA_CIDATA_MNT`: the mount point of the disk. `/mnt/lima-cidata`.
- `LIMA_CIDATA_USER`: the user name string
- `LIMA_CIDATA_UID`: the numeric UID
- `LIMA_CIDATA_HOME`: the guest home directory
Copy link
Member

@AkihiroSuda AkihiroSuda Aug 12, 2023

Choose a reason for hiding this comment

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

Maybe:

Suggested change
- `LIMA_CIDATA_HOME`: the guest home directory
- `LIMA_CIDATA_USER_HOME`: the guest home directory (`/home/foo.linux`)

Because we may potentially use LIMA_CIDATA_HOME for something like LIMA_HOME which is not a user home directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was supposed to be simple wrappers for $USER and $HOME, we can give them long and strange names like USER_NAME and USER_HOME but I'm not sure it will help? Better do something like LIMA_CIDATA_HOSTHOME (or LIMA_CIDATA_HOST_LIMA_HOME, or whatever it would end up looking like) when needed

Copy link
Member

Choose a reason for hiding this comment

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

This is not visible to end users anyway, so I don't have a strong opinion

@afbjorklund
Copy link
Member Author

It still duplicates the .linux in a lot of places, so there probably should be a wrapper method for that construct.

fmt.Sprintf("/home/%s.linux", u.Username)

Maybe it should even set Homedir in the LimaUser

@AkihiroSuda AkihiroSuda modified the milestones: v0.17.2, v0.18.0 Aug 13, 2023
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit ab3142b into lima-vm:master Aug 16, 2023
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.

2 participants