fix lint, fmt, generate

This commit is contained in:
sangkyu.kim 2021-04-06 11:40:41 +09:00
parent e22d9861aa
commit 23e8684aae
17 changed files with 24 additions and 19 deletions

View File

@ -6,9 +6,10 @@ package ncloud
import ( import (
"errors" "errors"
"fmt" "fmt"
"os"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vpc" "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vpc"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver" "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/ncloud"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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, // advance if you use CLASSIC env. If this field is left blank,
// Packer will create temporary ACG for automatically in VPC environment. // Packer will create temporary ACG for automatically in VPC environment.
AccessControlGroupNo string `mapstructure:"access_control_group_no" required:"false"` 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`. // 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"` 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`. // 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`.

View File

@ -3,11 +3,12 @@ package ncloud
import ( import (
"context" "context"
"fmt" "fmt"
"log"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver" "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"github.com/hashicorp/packer-plugin-sdk/multistep" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
"log"
) )
type StepCreateAccessControlGroup struct { type StepCreateAccessControlGroup struct {

View File

@ -4,12 +4,12 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" "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/server"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"github.com/hashicorp/packer-plugin-sdk/multistep" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -3,10 +3,10 @@ package ncloud
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
"io/ioutil" "io/ioutil"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver" "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"github.com/hashicorp/packer-plugin-sdk/multistep" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"

View File

@ -16,6 +16,7 @@ func TestStepCreateInitScriptShouldFailIfOperationCreateInitScriptFails(t *testi
Config: &Config{ Config: &Config{
Region: "Korea", Region: "Korea",
SupportVPC: true, SupportVPC: true,
UserData: "test",
}, },
} }

View File

@ -3,12 +3,12 @@ package ncloud
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" "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/server"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"github.com/hashicorp/packer-plugin-sdk/multistep" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -4,10 +4,10 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -4,13 +4,13 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"io/ioutil" "io/ioutil"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" "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/server"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"github.com/hashicorp/packer-plugin-sdk/multistep" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -4,11 +4,11 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" 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 { func (s *StepDeleteBlockStorage) deleteClassicBlockStorage(serverInstanceNo string) error {
blockStorageInstanceList := s.getClassicBlockList(serverInstanceNo) blockStorageInstanceList := s.getClassicBlockList(serverInstanceNo)
if blockStorageInstanceList == nil || len(blockStorageInstanceList) == 0 { if len(blockStorageInstanceList) == 0 {
return nil return nil
} }
reqParams := server.DeleteBlockStorageInstancesRequest{ reqParams := server.DeleteBlockStorageInstancesRequest{
@ -114,7 +114,7 @@ func (s *StepDeleteBlockStorage) deleteClassicBlockStorage(serverInstanceNo stri
func (s *StepDeleteBlockStorage) deleteVpcBlockStorage(serverInstanceNo string) error { func (s *StepDeleteBlockStorage) deleteVpcBlockStorage(serverInstanceNo string) error {
blockStorageInstanceList := s.getVpcBlockList(serverInstanceNo) blockStorageInstanceList := s.getVpcBlockList(serverInstanceNo)
if blockStorageInstanceList == nil || len(blockStorageInstanceList) == 0 { if len(blockStorageInstanceList) == 0 {
return nil return nil
} }
reqParams := vserver.DeleteBlockStorageInstancesRequest{ reqParams := vserver.DeleteBlockStorageInstancesRequest{

View File

@ -3,9 +3,9 @@ package ncloud
import ( import (
"context" "context"
"fmt" "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/server"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"github.com/hashicorp/packer-plugin-sdk/multistep" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -3,10 +3,10 @@ package ncloud
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -4,11 +4,11 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
) )

View File

@ -5,12 +5,12 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vpc"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"strings" "strings"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" "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/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" "github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer" packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"

View File

@ -2,11 +2,11 @@ package ncloud
import ( import (
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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 { func waiterClassicBlockStorageStatus(conn *NcloudAPIClient, blockStorageInstanceNo *string, status string, timeout time.Duration) error {

View File

@ -2,11 +2,11 @@ package ncloud
import ( import (
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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 { func waiterClassicMemberServerImageStatus(conn *NcloudAPIClient, memberServerImageNo string, status string, timeout time.Duration) error {

View File

@ -2,11 +2,11 @@ package ncloud
import ( import (
"fmt" "fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vserver"
"log" "log"
"time" "time"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server" "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 { func waiterClassicServerInstanceStatus(conn *NcloudAPIClient, serverInstanceNo string, status string, timeout time.Duration) error {

View File

@ -37,6 +37,8 @@
advance if you use CLASSIC env. If this field is left blank, advance if you use CLASSIC env. If this field is left blank,
Packer will create temporary ACG for automatically in VPC environment. 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`. - `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`. - `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`.