@ -18,7 +18,10 @@ import (
packerregistry "github.com/hashicorp/packer/internal/registry"
)
type Datasource struct {
// Type for Packer datasource has been renamed temporarily to prevent it from being
// automatically registered as a viable datasource plugin in command/plugin.go.
// In the future this type will be renamed to allow for the use of the datasource.
type DeactivatedDatasource struct {
config Config
}
@ -32,11 +35,11 @@ type Config struct {
// TODO: Label string `mapstructure:"label"`
}
func ( d * D atasource) ConfigSpec ( ) hcldec . ObjectSpec {
func ( d * D eactivatedD atasource) ConfigSpec ( ) hcldec . ObjectSpec {
return d . config . FlatMapstructure ( ) . HCL2Spec ( )
}
func ( d * D atasource) Configure ( raws ... interface { } ) error {
func ( d * D eactivatedD atasource) Configure ( raws ... interface { } ) error {
err := config . Decode ( & d . config , nil , raws ... )
if err != nil {
return err
@ -125,11 +128,11 @@ type DatasourceOutput struct {
Builds [ ] ParBuild ` mapstructure:"builds" `
}
func ( d * D atasource) OutputSpec ( ) hcldec . ObjectSpec {
func ( d * D eactivatedD atasource) OutputSpec ( ) hcldec . ObjectSpec {
return ( & DatasourceOutput { } ) . FlatMapstructure ( ) . HCL2Spec ( )
}
func ( d * D atasource) Execute ( ) ( cty . Value , error ) {
func ( d * D eactivatedD atasource) Execute ( ) ( cty . Value , error ) {
cli , err := packerregistry . NewClient ( )
if err != nil {
return cty . NullVal ( cty . EmptyObject ) , err