diff --git a/main.go b/main.go index 0878001..671c6c7 100644 --- a/main.go +++ b/main.go @@ -1,18 +1,17 @@ package main -//go:generate go run github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc mapstructure-to-hcl2 -type Config,SudoConfig - import ( "fmt" "os" "github.com/hashicorp/packer-plugin-sdk/plugin" + "go.mondoo.com/packer-plugin-mondoo/provisioner" "go.mondoo.com/packer-plugin-mondoo/version" ) func main() { pps := plugin.NewSet() - pps.RegisterProvisioner(plugin.DEFAULT_NAME, new(Provisioner)) + pps.RegisterProvisioner(plugin.DEFAULT_NAME, new(provisioner.Provisioner)) pps.SetVersion(version.PluginVersion) err := pps.Run() diff --git a/buildinfo.go b/provisioner/buildinfo.go similarity index 97% rename from buildinfo.go rename to provisioner/buildinfo.go index 8c49000..7627fcd 100644 --- a/buildinfo.go +++ b/provisioner/buildinfo.go @@ -1,4 +1,4 @@ -package main +package provisioner // https://www.packer.io/docs/templates/legacy_json_templates/engine type BuildInfo struct { diff --git a/buildinfo_test.go b/provisioner/buildinfo_test.go similarity index 97% rename from buildinfo_test.go rename to provisioner/buildinfo_test.go index 744e085..7dffd97 100644 --- a/buildinfo_test.go +++ b/provisioner/buildinfo_test.go @@ -1,4 +1,4 @@ -package main +package provisioner import ( "encoding/json" diff --git a/mondoo.go b/provisioner/mondoo.go similarity index 98% rename from mondoo.go rename to provisioner/mondoo.go index 19fa83f..e0ea381 100644 --- a/mondoo.go +++ b/provisioner/mondoo.go @@ -1,4 +1,4 @@ -package main +package provisioner type VulnOpts struct { Assets []*Asset `json:"assets,omitempty" mapstructure:"assets"` diff --git a/provisioner.go b/provisioner/provisioner.go similarity index 98% rename from provisioner.go rename to provisioner/provisioner.go index 4a8f189..b8f2b09 100644 --- a/provisioner.go +++ b/provisioner/provisioner.go @@ -1,4 +1,6 @@ -package main +package provisioner + +//go:generate go run github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc mapstructure-to-hcl2 -type Config,SudoConfig import ( "bufio" diff --git a/main.hcl2spec.go b/provisioner/provisioner.hcl2spec.go similarity index 99% rename from main.hcl2spec.go rename to provisioner/provisioner.hcl2spec.go index b2492b5..fb9795d 100644 --- a/main.hcl2spec.go +++ b/provisioner/provisioner.hcl2spec.go @@ -1,6 +1,6 @@ // Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT. -package main +package provisioner import ( "github.com/hashicorp/hcl/v2/hcldec" diff --git a/sshkey.go b/provisioner/sshkey.go similarity index 99% rename from sshkey.go rename to provisioner/sshkey.go index 2d9d50e..38faa49 100644 --- a/sshkey.go +++ b/provisioner/sshkey.go @@ -1,4 +1,4 @@ -package main +package provisioner import ( "crypto/rand"