see if this works for 1.15

This commit is contained in:
Megan Marsh 2021-02-25 16:26:10 -08:00
parent fbe6ebebf1
commit a416158371
3 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ package common
import ( import (
"fmt" "fmt"
"os" "io/fs"
"path/filepath" "path/filepath"
"github.com/hashicorp/packer-plugin-sdk/common" "github.com/hashicorp/packer-plugin-sdk/common"
@ -27,7 +27,7 @@ type OutputConfig struct {
// leading zero such as "0755" in JSON file, because JSON does not support // leading zero such as "0755" in JSON file, because JSON does not support
// octal value. In Unix-like OS, the actual permission may differ from // octal value. In Unix-like OS, the actual permission may differ from
// this value because of umask. // this value because of umask.
DirPerm os.FileMode `mapstructure:"directory_permission" required:"false"` DirPerm fs.FileMode `mapstructure:"directory_permission" required:"false"`
} }
func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error { func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error {
@ -45,7 +45,7 @@ func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig
func (c *OutputConfig) ListFiles() ([]string, error) { func (c *OutputConfig) ListFiles() ([]string, error) {
files := make([]string, 0, 10) files := make([]string, 0, 10)
visit := func(path string, info os.FileInfo, err error) error { visit := func(path string, info fs.FileInfo, err error) error {
if err != nil { if err != nil {
return err return err
} }

View File

@ -3,7 +3,7 @@
package common package common
import ( import (
"os" "io/fs"
"github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
@ -13,7 +13,7 @@ import (
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatOutputConfig struct { type FlatOutputConfig struct {
OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"` OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"`
DirPerm *os.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"` DirPerm *fs.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"`
} }
// FlatMapstructure returns a new FlatOutputConfig. // FlatMapstructure returns a new FlatOutputConfig.

View File

@ -3,7 +3,7 @@
package common package common
import ( import (
"os" "io/fs"
"github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
@ -17,7 +17,7 @@ type FlatExportConfig struct {
Images *bool `mapstructure:"images" cty:"images" hcl:"images"` Images *bool `mapstructure:"images" cty:"images" hcl:"images"`
Manifest *string `mapstructure:"manifest" cty:"manifest" hcl:"manifest"` Manifest *string `mapstructure:"manifest" cty:"manifest" hcl:"manifest"`
OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"` OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory" hcl:"output_directory"`
DirPerm *os.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"` DirPerm *fs.FileMode `mapstructure:"directory_permission" required:"false" cty:"directory_permission" hcl:"directory_permission"`
Options []string `mapstructure:"options" cty:"options" hcl:"options"` Options []string `mapstructure:"options" cty:"options" hcl:"options"`
} }