Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several key changes to enhance the VM instance management functionality. The changes include adding support for custom instance names, improving error handling, and updating tests to cover the new functionality.
Enhancements to VM instance management:
cli_config/cli_config.go
: Added a new fieldInstanceName
to theVmConfig
struct to support custom names for Lima VM instances.trellis/vm_instance.go
: Implemented functions to get and save the VM instance name based on a priority system (file, config, first site).trellis/trellis.go
: UpdatedMainSiteFromEnvironment
to use the newGetVMInstanceName
function for determining the main site based on the VM instance name.Improvements to VM commands:
cmd/vm_delete.go
: Modified theRun
method to remove the instance file if it exists when deleting a VM instance.cmd/vm_start.go
: Updated theRun
method to save the instance name after starting a VM instance.Updates to tests:
cmd/vm_delete_test.go
: Added a new testTestVmDeleteRemovesInstanceFile
to verify that the instance file is removed when a VM instance is deleted.cmd/vm_start_test.go
: Added a new testTestVmStartSavesInstanceName
to ensure that the instance name is saved correctly when a VM instance is started.trellis/vm_instance_test.go
: Added tests for the newGetVMInstanceName
andSaveVMInstanceName
functions to verify their behavior and priority system.