From 8c3c0418d4facaea203417b4e5ba6bf85012e7de Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 21 Jun 2018 15:12:55 -0400 Subject: [PATCH] add GetSchema to provisioner interface --- provisioners/provisioner.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/provisioners/provisioner.go b/provisioners/provisioner.go index 0cd86b99f..332d08c0c 100644 --- a/provisioners/provisioner.go +++ b/provisioners/provisioner.go @@ -1,12 +1,16 @@ package provisioner import ( + "github.com/hashicorp/terraform/config/configschema" "github.com/hashicorp/terraform/tfdiags" "github.com/zclconf/go-cty/cty" ) // Interface is the set of methods required for a resource provisioner plugin. type Interface interface { + // GetSchema returns the schema for the provisioner configuration. + GetSchema() GetSchemaResponse + // ValidateProvisionerConfig allows the provisioner to validate the // configuration values. ValidateProvisionerConfig(ValidateProvisionerConfigRequest) ValidateProvisionerConfigResponse @@ -30,6 +34,14 @@ type Interface interface { Stop() error } +type GetSchemaResponse struct { + // Provisioner contains the schema for this provisioner. + Provisioner *configschema.Block + + // Diagnostics contains any warnings or errors from the method call. + Diagnostics tfdiags.Diagnostics +} + // UIOutput provides the Output method for resource provisioner // plugins to write any output to the UI. //