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.
This commit is contained in:
Martin Atkins 2023-11-14 14:05:27 -08:00
parent 8a99c3c0e5
commit b9e327dd1d

View file

@ -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": {},
}
}