(cmd): unhide client agent commands (#5097)

pull/5102/head
Irena Rindos 2 years ago committed by GitHub
parent 15d440a90d
commit 83b61275d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -48,10 +48,8 @@ func addToken(ctx context.Context, apiClient *api.Client, port uint16) (*api.Res
client.RetryWaitMin = 100 * time.Millisecond
client.RetryWaitMax = 1500 * time.Millisecond
// TODO (ICU-13140): Until we release the client agent, do not retry attempts
// to connect to the client agent since it adds a noticeably long delay to
// the command.
client.RetryMax = 0
// Explicitly setting this to 1, since this runs after every command and we don't want any delays
client.RetryMax = 1
req, err := retryablehttp.NewRequestWithContext(ctx, "POST", clientAgentUrl(port, "v1/tokens"),
retryablehttp.ReaderFunc(func() (io.Reader, error) {

@ -118,6 +118,7 @@ func (c *StatusCommand) Status(ctx context.Context) (*api.Response, *GetStatusRe
client.Logger = nil
client.RetryWaitMin = 100 * time.Millisecond
client.RetryWaitMax = 1500 * time.Millisecond
client.RetryMax = 1
req, err := retryablehttp.NewRequestWithContext(ctx, "GET", clientAgentUrl(c.FlagClientAgentPort, "v1/status"), nil)
if err != nil {

@ -5,14 +5,23 @@ package clientagentcmd
import (
"context"
"os"
"strings"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/wrapper"
)
// TODO (ICU-13140): Remove this and re-enable error output for background
// client agent token sending.
const allowErrorOutput = false
var allowErrorOutput = false
const EnvBoundaryClientAgentCliErrorOutput = "BOUNDARY_CLIENT_AGENT_CLI_ERROR_OUTPUT"
func init() {
errOutput := os.Getenv(EnvBoundaryClientAgentCliErrorOutput)
if strings.ToLower(errOutput) == "true" {
allowErrorOutput = true
}
}
func init() {
if err := wrapper.RegisterSuccessfulCommandCallback("client-agent", hook); err != nil {

@ -241,7 +241,7 @@ func RunCustom(args []string, runOpts *RunOptions) (exitCode int) {
initCommands(ui, serverCmdUi, runOpts)
hiddenCommands := []string{"version", "client-agent", "client-agent status", "client-agent pause", "client-agent resume", "client-agent sessions"}
hiddenCommands := []string{"version"}
cli := &cli.CLI{
Name: "boundary",

Loading…
Cancel
Save