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

Refactor Lima config management #449

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

swalkinshaw
Copy link
Member

Fixes #421

Changes how the CLI generates and manages Lima VM configs to make changes like mounted directories be accurately reflected in Lima.

trellis-cli used to generate a config for Lima in
.trellis/lima/{name}.yml which was used for the initial creation of the VM. However, even when providing a config to limactl create, Lima creates a separate config in its managed directory ($HOME/.lima/{name}/lima.yaml).

This meant that any subsequent config changes in Trellis might only be persisted to the CLI's managed config (in .trellis), which would do nothing, instead of Lima's config.

For example, if you added a new site to Trellis (or changed the path to an existing one), you'd either have to delete the VM entirely and start over, or manually make the changes to Lima's config.

This PR removes the old CLI managed config entirely and instead updates Lima's config directly (the one in $HOME/.lima). This means one less file to manage and a single source of truth which will allow proper VM udpates.

Now if you change any wordpress sites in development, stopping and restarting the VM will apply the new config changes.

Changes how the CLI generates and manages Lima VM configs to make
changes like mounted directories be accurately reflected in Lima.

trellis-cli used to generate a config for Lima in
`.trellis/lima/{name}.yml` which was used for the initial creation of
the VM. However, even when providing a config to `limactl create`, Lima
creates a separate config in its managed directory (`$HOME/.lima/{name}/lima.yaml`).

This meant that any subsequent config changes in Trellis might only be
persisted to the CLI's managed config (in `.trellis`), which would do
nothing, instead of Lima's config.

For example, if you added a new site to Trellis (or changed the path to
an existing one), you'd either have to delete the VM entirely and start
over, or manually make the changes to Lima's config.

This PR removes the old CLI managed config entirely and instead updates
Lima's config directly (the one in `$HOME/.lima`). This means one less
file to manage and a single source of truth which will allow proper VM
udpates.

Now if you change any wordpress sites in development, stopping and
restarting the VM will apply the new config changes.
@swalkinshaw swalkinshaw force-pushed the refactor-lima-config-management branch from 9748204 to bca23c1 Compare August 1, 2024 03:39
@swalkinshaw swalkinshaw merged commit 57a8e99 into master Aug 3, 2024
3 checks passed
@swalkinshaw swalkinshaw deleted the refactor-lima-config-management branch August 3, 2024 00:13
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.

Trellis Lima not adding new mounts
1 participant