Skip to content

Commit 66d2518

Browse files
Le Garrec Maëlizissise
authored andcommitted
add boot-type option to run command
1 parent 97d879a commit 66d2518

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

pkg/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ type ScalewayServerDefinition struct {
653653

654654
SecurityGroup string `json:"security_group,omitempty"`
655655

656-
BootType string `json:"boot_type,omitempty"`
656+
BootType string `json:"boot_type,omitempty"`
657657
}
658658

659659
// ScalewayOneServer represents the response of a GET /servers/UUID API call

pkg/cli/cmd_run.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func init() {
4646
cmdRun.Flag.StringVar(&runGateway, []string{"g", "-gateway"}, "", "Use a SSH gateway")
4747
cmdRun.Flag.StringVar(&runUserdatas, []string{"u", "-userdata"}, "", "Start a server with userdata predefined")
4848
cmdRun.Flag.StringVar(&runCommercialType, []string{"-commercial-type"}, "X64-2GB", "Start a server with specific commercial-type C1, C2[S|M|L], X64-[2|4|8|15|30|60|120]GB, ARM64-[2|4|8]GB")
49+
cmdRun.Flag.StringVar(&runBootType, []string{"-boot-type"}, "local", "Choose between 'local' and 'bootscript' boot")
4950
cmdRun.Flag.StringVar(&runSSHUser, []string{"-user"}, "root", "Specify SSH User")
5051
cmdRun.Flag.BoolVar(&runAutoRemove, []string{"-rm"}, false, "Automatically remove the server when it exits")
5152
cmdRun.Flag.BoolVar(&runIPV6, []string{"-ipv6"}, false, "Enable IPV6")
@@ -68,6 +69,7 @@ var runDetachFlag bool // -d, --detach flag
6869
var runGateway string // -g, --gateway flag
6970
var runUserdatas string // -u, --userdata flag
7071
var runCommercialType string // --commercial-type flag
72+
var runBootType string // --boot-type flag
7173
var runTmpSSHKey bool // --tmp-ssh-key flag
7274
var runShowBoot bool // --show-boot flag
7375
var runIPV6 bool // --ipv6 flag
@@ -124,6 +126,7 @@ func runRun(cmd *Command, rawArgs []string) error {
124126
IPV6: runIPV6,
125127
SSHUser: runSSHUser,
126128
SSHPort: runSSHPort,
129+
BootType: runBootType,
127130
// FIXME: Timeout
128131
}
129132

pkg/commands/run.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type RunArgs struct {
3232
CommercialType string
3333
State string
3434
SSHUser string
35+
BootType string
3536
Timeout int64
3637
SSHPort int
3738
AutoRemove bool
@@ -170,6 +171,7 @@ func Run(ctx CommandContext, args RunArgs) error {
170171
IP: args.IP,
171172
CommercialType: args.CommercialType,
172173
EnableIPV6: args.IPV6,
174+
BootType: args.BootType,
173175
}
174176
if args.IP == "dynamic" || (args.IP == "" && args.Gateway == "") {
175177
config.DynamicIPRequired = true

0 commit comments

Comments
 (0)