Rename vm_flavour to vm_type

This commit is contained in:
Miłosz Smółka 2019-02-01 18:57:43 +01:00
parent e7e84f04e7
commit 4704565869
5 changed files with 11 additions and 11 deletions

View File

@ -25,7 +25,7 @@ const testBuilderAccBasic = `
{
"builders": [{
"type": "test",
"vm_flavour": "a1.nano",
"vm_type": "a1.nano",
"source_image": "5c3fef425ceadc3d412beee5",
"disk_size": 10
}]

View File

@ -45,7 +45,7 @@ type Config struct {
ImageTags map[string]interface{} `mapstructure:"image_tags"`
ImageService string `mapstructure:"image_service"`
VmFlavour string `mapstructure:"vm_flavour"`
VmType string `mapstructure:"vm_type"`
VmName string `mapstructure:"vm_name"`
VmTags map[string]interface{} `mapstructure:"vm_tags"`
@ -207,8 +207,8 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
errs = packer.MultiErrorAppend(errs, errors.New("token is required"))
}
if c.VmFlavour == "" {
errs = packer.MultiErrorAppend(errs, errors.New("vm flavour is required"))
if c.VmType == "" {
errs = packer.MultiErrorAppend(errs, errors.New("vm type is required"))
}
if c.DiskSize == 0 {

View File

@ -48,7 +48,7 @@ func (s *stepCreateVM) Run(ctx context.Context, state multistep.StateBag) multis
options := openapi.VmCreate{
Name: config.VmName,
Image: config.SourceImage,
Service: config.VmFlavour,
Service: config.VmType,
SshKeys: sshKeys,
Disk: disks,
Netadp: []openapi.VmCreateNetadp{netAdapter},

View File

@ -24,7 +24,7 @@ func (s *stepCreateVMFromDisk) Run(ctx context.Context, state multistep.StateBag
options := openapi.VmCreate{
Name: config.VmName,
Service: config.VmFlavour,
Service: config.VmType,
Disk: []openapi.VmCreateDisk{
{
Id: chrootDiskID,

View File

@ -108,7 +108,7 @@ builder.
- In `~/.h1-cli/conf.json` config file used by [h1-cli](https://github.com/hyperonecom/h1-cli).
- By using SSH authentication if `token_login` variable has been set.
- `vm_flavour` (string) - ID or name of the type this server should be created with.
- `vm_type` (string) - ID or name of the type this server should be created with.
### Optional:
@ -215,7 +215,7 @@ token.
"type": "hyperone",
"token": "YOUR_AUTH_TOKEN",
"source_image": "ubuntu-18.04",
"vm_flavour": "a1.nano",
"vm_type": "a1.nano",
"disk_size": 10
}
```
@ -228,7 +228,7 @@ token.
"type": "hyperone",
"token": "YOUR_AUTH_TOKEN",
"source_image": "ubuntu-18.04",
"vm_flavour": "a1.nano",
"vm_type": "a1.nano",
"disk_size": 10,
"chroot_disk": true,
"pre_mount_commands": [