Skip to content

Commit

Permalink
Merge pull request #445 from roots/ubuntu-24-04
Browse files Browse the repository at this point in the history
Ubuntu 24.04 support
  • Loading branch information
swalkinshaw authored Jul 29, 2024
2 parents 8b6976b + 7be0ab2 commit 4122c50
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Current supported settings:
| Setting | Description | Type | Default |
| --- | --- | -- | -- |
| `manager` | VM manager (Options: `auto` (depends on OS), `lima`)| string | "auto" |
| `ubuntu` | Ubuntu OS version (Options: `18.04`, `20.04`, `22.04`)| string |
| `ubuntu` | Ubuntu OS version (Options: `18.04`, `20.04`, `22.04`, `24.04`)| string |
| `hosts_resolver` | VM hosts resolver (Options: `hosts_file`)| string |
| `images` | Custom OS image | object | Set based on `ubuntu` version |
Expand Down
4 changes: 2 additions & 2 deletions cli_config/cli_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func (c *Config) LoadFile(path string) error {
return fmt.Errorf("%w: unsupported value for `vm.manager`. Must be one of: auto, lima", InvalidConfigErr)
}

if c.Vm.Ubuntu != "18.04" && c.Vm.Ubuntu != "20.04" && c.Vm.Ubuntu != "22.04" {
return fmt.Errorf("%w: unsupported value for `vm.ubuntu`. Must be one of: 18.04, 20.04, 22.04", InvalidConfigErr)
if c.Vm.Ubuntu != "18.04" && c.Vm.Ubuntu != "20.04" && c.Vm.Ubuntu != "22.04" && c.Vm.Ubuntu != "24.04" {
return fmt.Errorf("%w: unsupported value for `vm.ubuntu`. Must be one of: 18.04, 20.04, 22.04, 24.04", InvalidConfigErr)
}

if c.Vm.HostsResolver != "hosts_file" {
Expand Down
12 changes: 12 additions & 0 deletions pkg/lima/ubuntu.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@ var UbuntuImages = map[string][]Image{
Arch: "aarch64",
},
},
"24.04": {
{
Alias: "noble",
Location: "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img",
Arch: "x86_64",
},
{
Alias: "noble",
Location: "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img",
Arch: "aarch64",
},
},
}
2 changes: 1 addition & 1 deletion trellis/trellis.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var DefaultCliConfig = cli_config.Config{
Vm: cli_config.VmConfig{
Manager: "auto",
HostsResolver: "hosts_file",
Ubuntu: "22.04",
Ubuntu: "24.04",
},
}

Expand Down

0 comments on commit 4122c50

Please sign in to comment.