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

feat(apple_silicon): add os selection fields #3790

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ USAGE:
ARGS:
[name=<generated>] Create a server with this given name
[project-id] Project ID to use. If none is passed the default project ID will be used
[type] Create a server of the given type
[type=M1-M] Create a server of the given type
[os-id] Create a server with the given os_id
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ USAGE:

ARGS:
server-id UUID of the server you want to reinstall
[os-id] Reinstall the server with the OS corresponding to the os_id
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
Expand Down
4 changes: 3 additions & 1 deletion docs/commands/apple-silicon.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ scw apple-silicon server create [arg=value ...]
|------|---|-------------|
| name | Default: `<generated>` | Create a server with this given name |
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| type | | Create a server of the given type |
| type | Default: `M1-M` | Create a server of the given type |
| os-id | | Create a server with the given os_id |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |


Expand Down Expand Up @@ -191,6 +192,7 @@ scw apple-silicon server reinstall <server-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| server-id | Required | UUID of the server you want to reinstall |
| os-id | | Reinstall the server with the OS corresponding to the os_id |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.1
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26.0.20240423143305-90f2be290160
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26.0.20240424161651-0ea1f231f7b9
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26.0.20240423143305-90f2be290160 h1:znYgQ3fNt63dMk5kJ9+56YzEPWVKgIRkcmI++ThuHU4=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26.0.20240423143305-90f2be290160/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26.0.20240424161651-0ea1f231f7b9 h1:XdyRhuhdO4HVcwdRuKzv3fiJ/DHYT8PyotTby3v/doc=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.26.0.20240424161651-0ea1f231f7b9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
15 changes: 15 additions & 0 deletions internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ func appleSiliconServerCreate() *core.Command {
Required: false,
Deprecated: false,
Positional: false,
Default: core.DefaultValueSetter("M1-M"),
},
{
Name: "os-id",
Short: `Create a server with the given os_id`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Expand Down Expand Up @@ -443,6 +451,13 @@ func appleSiliconServerReinstall() *core.Command {
Deprecated: false,
Positional: true,
},
{
Name: "os-id",
Short: `Reinstall the server with the OS corresponding to the os_id`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down
Loading