From ff62192819d9a976711762b2d994aa736e867afe Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Fri, 5 Jan 2024 13:58:14 -0800 Subject: [PATCH] Adjust CloudPluginConfig doc comments --- internal/command/cloud.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/command/cloud.go b/internal/command/cloud.go index e3aebb9b1d..2c28efb821 100644 --- a/internal/command/cloud.go +++ b/internal/command/cloud.go @@ -282,23 +282,25 @@ func (c *CloudCommand) Synopsis() string { return "Manage Terraform Cloud settings and metadata" } -// Everything the cloud plugin needs to know to configure a client and talk to TFC. +// CloudPluginConfig is everything the cloud plugin needs to know to configure a +// client and talk to TFC. type CloudPluginConfig struct { // Maybe someday we can use struct tags to automate grabbing these out of // the metadata headers! And verify client-side that we're sending the right // stuff, instead of having it all be a stringly-typed mystery ball! I want // to believe in that distant shining day! 🌻 Meantime, these struct tags // serve purely as docs. - Address string `md:"tfc-address"` - BasePath string `md:"tfc-base-path"` - DisplayHostname string `md:"tfc-display-hostname"` - Token string `md:"tfc-token"` - Organization string `md:"tfc-organization"` + Address string `md:"tfc-address"` + BasePath string `md:"tfc-base-path"` + DisplayHostname string `md:"tfc-display-hostname"` + Token string `md:"tfc-token"` + Organization string `md:"tfc-organization"` + // The actual selected workspace CurrentWorkspace string `md:"tfc-current-workspace"` - // The classic "WorkspaceMapping" attributes. I think 90% of the time we - // actually won't care about these, and just want the current workspace - // instead. + // The raw "WorkspaceMapping" attributes, which determine the workspaces + // that could be selected. Generally you want CurrentWorkspace instead, but + // these can potentially be useful for niche use cases. WorkspaceName string `md:"tfc-workspace-name"` WorkspaceTags []string `md:"tfc-workspace-tags"` DefaultProjectName string `md:"tfc-default-project-name"`