fix lint, fmt, generate
This commit is contained in:
parent
e22d9861aa
commit
23e8684aae
|
@ -6,9 +6,10 @@ package ncloud
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vpc"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"os"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
|
@ -62,7 +63,7 @@ type Config struct {
|
|||
// advance if you use CLASSIC env. If this field is left blank,
|
||||
// Packer will create temporary ACG for automatically in VPC environment.
|
||||
AccessControlGroupNo string `mapstructure:"access_control_group_no" required:"false"`
|
||||
SupportVPC bool `mapstructure:"support_vpc" required:"false"`
|
||||
SupportVPC bool `mapstructure:"support_vpc" required:"false"`
|
||||
// The ID of the Subnet where you want to place the Server Instance. If this field is left blank, Packer will try to get the Public Subnet ID from the `vpc_no`.
|
||||
SubnetNo string `mapstructure:"subnet_no" required:"false"`
|
||||
// The ID of the VPC where you want to place the Server Instance. If this field is left blank, Packer will try to get the VPC ID from the `subnet_no`.
|
||||
|
|
|
@ -3,11 +3,12 @@ package ncloud
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
"log"
|
||||
)
|
||||
|
||||
type StepCreateAccessControlGroup struct {
|
||||
|
|
|
@ -4,12 +4,12 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -3,10 +3,10 @@ package ncloud
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
|
|
|
@ -16,6 +16,7 @@ func TestStepCreateInitScriptShouldFailIfOperationCreateInitScriptFails(t *testi
|
|||
Config: &Config{
|
||||
Region: "Korea",
|
||||
SupportVPC: true,
|
||||
UserData: "test",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ package ncloud
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -4,13 +4,13 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
@ -92,7 +92,7 @@ func (s *StepDeleteBlockStorage) getVpcBlockList(serverInstanceNo string) []*str
|
|||
|
||||
func (s *StepDeleteBlockStorage) deleteClassicBlockStorage(serverInstanceNo string) error {
|
||||
blockStorageInstanceList := s.getClassicBlockList(serverInstanceNo)
|
||||
if blockStorageInstanceList == nil || len(blockStorageInstanceList) == 0 {
|
||||
if len(blockStorageInstanceList) == 0 {
|
||||
return nil
|
||||
}
|
||||
reqParams := server.DeleteBlockStorageInstancesRequest{
|
||||
|
@ -114,7 +114,7 @@ func (s *StepDeleteBlockStorage) deleteClassicBlockStorage(serverInstanceNo stri
|
|||
|
||||
func (s *StepDeleteBlockStorage) deleteVpcBlockStorage(serverInstanceNo string) error {
|
||||
blockStorageInstanceList := s.getVpcBlockList(serverInstanceNo)
|
||||
if blockStorageInstanceList == nil || len(blockStorageInstanceList) == 0 {
|
||||
if len(blockStorageInstanceList) == 0 {
|
||||
return nil
|
||||
}
|
||||
reqParams := vserver.DeleteBlockStorageInstancesRequest{
|
||||
|
|
|
@ -3,9 +3,9 @@ package ncloud
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -3,10 +3,10 @@ package ncloud
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
)
|
||||
|
|
|
@ -5,12 +5,12 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vpc"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"strings"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vpc"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"github.com/hashicorp/packer-plugin-sdk/multistep"
|
||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
|
|
|
@ -2,11 +2,11 @@ package ncloud
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
)
|
||||
|
||||
func waiterClassicBlockStorageStatus(conn *NcloudAPIClient, blockStorageInstanceNo *string, status string, timeout time.Duration) error {
|
||||
|
|
|
@ -2,11 +2,11 @@ package ncloud
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
)
|
||||
|
||||
func waiterClassicMemberServerImageStatus(conn *NcloudAPIClient, memberServerImageNo string, status string, timeout time.Duration) error {
|
||||
|
|
|
@ -2,11 +2,11 @@ package ncloud
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
|
||||
)
|
||||
|
||||
func waiterClassicServerInstanceStatus(conn *NcloudAPIClient, serverInstanceNo string, status string, timeout time.Duration) error {
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
advance if you use CLASSIC env. If this field is left blank,
|
||||
Packer will create temporary ACG for automatically in VPC environment.
|
||||
|
||||
- `support_vpc` (bool) - Support VPC
|
||||
|
||||
- `subnet_no` (string) - The ID of the Subnet where you want to place the Server Instance. If this field is left blank, Packer will try to get the Public Subnet ID from the `vpc_no`.
|
||||
|
||||
- `vpc_no` (string) - The ID of the VPC where you want to place the Server Instance. If this field is left blank, Packer will try to get the VPC ID from the `subnet_no`.
|
||||
|
|
Loading…
Reference in New Issue