From b9e327dd1d071a41673c5674012c50d3ee044522 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 14 Nov 2023 14:05:27 -0800 Subject: [PATCH] main: The "terraform rpcapi" command is experimental For the moment this command is only used as part of the Terraform Stacks workflow, which is in private preview. It's not yet suitable for any use outside of that context because we're likely to make significant breaking changes to this in response to feedback. As usual with "experimental" features, the idea here is to allow this to be included in alpha/dev builds while not yet including it in stable releases or non-alpha prereleases. We're landing this here now primarily so we can do remaining development in the public repository, now that the conference announcement embargo for Stacks has been lifted. --- commands.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/commands.go b/commands.go index 683e07e66d..1237bfe49a 100644 --- a/commands.go +++ b/commands.go @@ -276,17 +276,6 @@ func initCommands( }, nil }, - // "rpcapi" is handled a bit differently because the whole point of - // this interface is to bypass the CLI layer so wrapping automation can - // get as-direct-as-possible access to Terraform Core functionality, - // without interference from behaviors that are intended for CLI - // end-user convenience. We bypass the "command" package entirely - // for this command in particular. - "rpcapi": rpcapi.CLICommandFactory(rpcapi.CommandFactoryOpts{ - ExperimentsAllowed: meta.AllowExperimentalFeatures, - ShutdownCh: meta.ShutdownCh, - }), - "show": func() (cli.Command, error) { return &command.ShowCommand{ Meta: meta, @@ -432,6 +421,17 @@ func initCommands( Meta: meta, }, nil } + + // "rpcapi" is handled a bit differently because the whole point of + // this interface is to bypass the CLI layer so wrapping automation can + // get as-direct-as-possible access to Terraform Core functionality, + // without interference from behaviors that are intended for CLI + // end-user convenience. We bypass the "command" package entirely + // for this command in particular. + Commands["rpcapi"] = rpcapi.CLICommandFactory(rpcapi.CommandFactoryOpts{ + ExperimentsAllowed: meta.AllowExperimentalFeatures, + ShutdownCh: meta.ShutdownCh, + }) } PrimaryCommands = []string{ @@ -443,10 +443,10 @@ func initCommands( } HiddenCommands = map[string]struct{}{ - "env": struct{}{}, - "internal-plugin": struct{}{}, - "push": struct{}{}, - "rpcapi": struct{}{}, + "env": {}, + "internal-plugin": {}, + "push": {}, + "rpcapi": {}, } }