Skip to content

Commit

Permalink
update tests and website and generated partials to reflect new packag…
Browse files Browse the repository at this point in the history
…e format
  • Loading branch information
SwampDragons committed Nov 17, 2020
1 parent 3da99f7 commit 7d65814
Show file tree
Hide file tree
Showing 420 changed files with 517 additions and 508 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ does not attempt to track the latest version for each dependency.
#### Code generation

Packer relies on `go generate` to generate a [peg parser for boot
commands](https://github.com/hashicorp/packer/blob/master/common/bootcommand/boot_command.go),
commands](https://github.com/hashicorp/packer/blob/master/packer-plugin-sdk/bootcommand/boot_command.go),
[docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx)
and HCL2's bridging code. Packer's testing suite will run `make check-generate`
to check that all the generated files Packer needs are what they should be.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ generate: install-gen-deps ## Generate dynamically generated code
@echo "==> removing autogenerated markdown..."
@find website/pages/ -type f | xargs grep -l '^<!-- Code generated' | xargs rm -f
@echo "==> removing autogenerated code..."
@find post-processor common helper template builder provisioner -type f | xargs grep -l '^// Code generated' | xargs rm -f
@find post-processor packer-plugin-sdk helper template builder provisioner -type f | xargs grep -l '^// Code generated' | xargs rm -f
go generate ./...
go fmt common/bootcommand/boot_command.go
go fmt packer-plugin-sdk/bootcommand/boot_command.go
go run ./cmd/generate-fixer-deprecations

generate-check: generate ## Check go code generation is on par
Expand Down
4 changes: 2 additions & 2 deletions builder/alicloud/ecs/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"fmt"

"github.com/hashicorp/hcl/v2/hcldec"
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/common/commonsteps"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/config"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/common"
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/alicloud/ecs/run_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"strings"

"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/config"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type RunConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/alicloud/ecs/step_config_eip.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
Expand Down
2 changes: 1 addition & 1 deletion builder/alicloud/ecs/step_config_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type stepConfigAlicloudSecurityGroup struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/alicloud/ecs/step_config_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type stepConfigAlicloudVPC struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/alicloud/ecs/step_config_vswitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type stepConfigAlicloudVSwitch struct {
Expand Down
4 changes: 2 additions & 2 deletions builder/alicloud/ecs/step_create_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"fmt"
"time"

"github.com/hashicorp/packer/common/random"
"github.com/hashicorp/packer/packer-plugin-sdk/random"

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type stepCreateAlicloudImage struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/alicloud/ecs/step_create_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io/ioutil"
"strconv"

"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"

"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
Expand Down
8 changes: 4 additions & 4 deletions builder/amazon/chroot/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/hcl/v2/hcldec"
awscommon "github.com/hashicorp/packer/builder/amazon/common"
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/common/chroot"
"github.com/hashicorp/packer/common/commonsteps"
"github.com/hashicorp/packer/common/packerbuilderdata"
"github.com/hashicorp/packer/hcl2template"
"github.com/hashicorp/packer/helper/config"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
"github.com/hashicorp/packer/packer-plugin-sdk/common"
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/copy_files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"testing"

"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/packer-plugin-sdk/common"
)

func TestCopyFile(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_attach_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package chroot
import (
"testing"

"github.com/hashicorp/packer/common/chroot"
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
)

func TestAttachVolumeCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_early_unflock.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"log"

"github.com/hashicorp/packer/common/chroot"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
)

// StepEarlyUnflock unlocks the flock.
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_flock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package chroot
import (
"testing"

"github.com/hashicorp/packer/common/chroot"
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
)

func TestFlockCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions builder/amazon/chroot/step_mount_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"strings"

"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/common/packerbuilderdata"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/common"
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_mount_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package chroot
import (
"testing"

"github.com/hashicorp/packer/common/chroot"
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
)

func TestMountDeviceCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_prepare_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"log"
"os"

"github.com/hashicorp/packer/common/packerbuilderdata"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
)

// StepPrepareDevice finds an available device and sets it.
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_register_ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
awscommon "github.com/hashicorp/packer/builder/amazon/common"
"github.com/hashicorp/packer/common/random"
confighelper "github.com/hashicorp/packer/helper/config"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/random"
)

// StepRegisterAMI creates the AMI.
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/chroot/step_register_ami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

amazon "github.com/hashicorp/packer/builder/amazon/common"
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/packer-plugin-sdk/common"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/helper_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
)

// DestroyAMIs deregisters the AWS machine images in imageids from an active AWS account
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/interpolate_build_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package common
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common/packerbuilderdata"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
)

type BuildInfoTemplate struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/interpolate_build_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common/packerbuilderdata"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
)

func testImage() *ec2.Image {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/run_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"strings"
"time"

"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/hcl2template"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

var reShutdownBehavior = regexp.MustCompile("^(stop|terminate)$")
Expand Down
4 changes: 2 additions & 2 deletions builder/amazon/common/ssm/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/aws/aws-sdk-go/service/ssm"
"github.com/aws/aws-sdk-go/service/ssm/ssmiface"
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/common/shell-local/localexec"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
"github.com/hashicorp/packer/packer-plugin-sdk/shell-local/localexec"
)

type Session struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_create_ssm_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ssm"
pssm "github.com/hashicorp/packer/builder/amazon/common/ssm"
"github.com/hashicorp/packer/common/net"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/net"
)

type StepCreateSSMTunnel struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_create_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_get_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"time"

"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
)

// StepGetPassword reads the password from a Windows server and sets it
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_iam_instance_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type StepIamInstanceProfile struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_key_pair.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"time"

"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
)

type StepKeyPair struct {
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_modify_ami_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common/packerbuilderdata"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_pre_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
)

// StepPreValidate provides an opportunity to pre-validate any configuration for
Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_run_source_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"

"github.com/hashicorp/packer/builder/amazon/common/awserrors"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
4 changes: 2 additions & 2 deletions builder/amazon/common/step_run_spot_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
"github.com/hashicorp/packer/common/random"
"github.com/hashicorp/packer/common/retry"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/random"
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
)

Expand Down
2 changes: 1 addition & 1 deletion builder/amazon/common/step_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/packer/common/uuid"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
)

type StepSecurityGroup struct {
Expand Down
Loading

0 comments on commit 7d65814

Please sign in to comment.