Commit Graph

1749 Commits

Author SHA1 Message Date
Matt Keeler e043621dd3
Merge pull request #4156 from hashicorp/enterprise-coexistence
Enterprise/Licensing Cleanup
2018-06-05 10:50:32 -04:00
Paul Banks 0b9ff5c2b9
Fix KV del command validation error
This has an explcit unit test already which somehow passes at least some of the time. I suspect it passes because under some conditions the actual KV delete fails and returns non-zero as well as printing the warning which is what is being checked for in the test.

For some reason despite working for quite some time like this, I now have a branch in which this test fails consistently. It may be a timing/env issue where another process running an agent causes the delete to be successful so the command returns a 0 by chance. Either way this is clearly wrong and fixing it stops the test being flaky in my branch.
2018-06-05 13:18:16 +01:00
Kyle Havlovitz 1e47c757c2
command/agent: don't re-parse the flags on reload 2018-05-31 16:59:51 -07:00
Matt Keeler 34c84aabb5 Move data source loading into a command helpers function 2018-05-24 10:34:08 -04:00
Paul Banks 06e1a62653
Merge pull request #4016 from pierresouchay/support_for_prometheus
Support for prometheus for metrics endpoint
2018-04-24 16:14:43 +01:00
Matt Keeler 3026ac4198
Merge pull request #4024 from jen20/signal-notify-once
Only call signal.Notify once during agent startup
2018-04-20 12:37:01 -04:00
Kyle Havlovitz be10300d06
Update make static-assets goal and run format 2018-04-13 09:57:25 -07:00
James Nugent e96b2b8d09 Only call signal.Notify once during agent startup
Calling twice appears to have no adverse effects, however serves to
confuse as to what the semantics of such code may be! This seems like it
was probably introduced while resolving conflicts during the merge of
the fix for #2404.
2018-04-10 20:44:50 -05:00
Pierre Souchay 2e495ec8a6 Now use prometheus_retention_time > 0 to enable prometheus support 2018-04-06 14:21:05 +02:00
Pierre Souchay 583744d8c5 Added support exposing metrics in Prometheus format 2018-04-06 09:18:06 +02:00
Matt Keeler 8a9240ff78 Address PR feedback 2018-04-02 09:23:01 -04:00
Matt Keeler 5ddca9633f Update unit-tests to use requirements instead of manual checks. 2018-03-30 10:55:21 -04:00
Matt Keeler 3cefdd63d7 Update case of member in comment 2018-03-29 15:06:48 -04:00
Matt Keeler 7753fa25f6 Formatting update 2018-03-29 14:35:49 -04:00
Matt Keeler 0bf8adfbe0 GH-3996: Add config-format flag to validate subcommand 2018-03-29 14:30:05 -04:00
Guido Iaquinti 244fc72b05 Add package name to log output 2018-03-21 15:56:14 +00:00
Josh Soref 1dd8c378b9 Spelling (#3958)
* spelling: another

* spelling: autopilot

* spelling: beginning

* spelling: circonus

* spelling: default

* spelling: definition

* spelling: distance

* spelling: encountered

* spelling: enterprise

* spelling: expands

* spelling: exits

* spelling: formatting

* spelling: health

* spelling: hierarchy

* spelling: imposed

* spelling: independence

* spelling: inspect

* spelling: last

* spelling: latest

* spelling: client

* spelling: message

* spelling: minimum

* spelling: notify

* spelling: nonexistent

* spelling: operator

* spelling: payload

* spelling: preceded

* spelling: prepared

* spelling: programmatically

* spelling: required

* spelling: reconcile

* spelling: responses

* spelling: request

* spelling: response

* spelling: results

* spelling: retrieve

* spelling: service

* spelling: significantly

* spelling: specifies

* spelling: supported

* spelling: synchronization

* spelling: synchronous

* spelling: themselves

* spelling: unexpected

* spelling: validations

* spelling: value
2018-03-19 16:56:00 +00:00
Paul Banks 69ebbf3e79
Fixes #3891: agent monitor no longer unresponsive before logs stream.
The root cause is actually that the agent's streaming HTTP API didn't flush until the first log line was found which commonly was pretty soon since the default level is INFO. In cases where there were no logs immediately due to level for instance, the client gets stuck in the HTTP code waiting on a response packet from the server before we enter the loop that checks the shutdown channel from the signal handler.

This fix flushes the initial status immediately on the streaming endpoint which lets the client code get into it's expected state where it's listening for shutdown or log lines.
2018-02-19 21:53:10 +00:00
Kyle Havlovitz 7f3a1c1175
Pull http config flag merge into public method 2018-02-05 15:00:04 -08:00
Veselkov Konstantin 05666113a4 remove golint warnings 2018-01-28 22:40:13 +04:00
Chad Whitacre 923e2c8535 Fix typo 2018-01-05 15:24:44 -05:00
Kyle Havlovitz 6b58df5898
Merge pull request #3737 from hashicorp/autopilot-refactor
Move autopilot to a standalone package
2017-12-15 14:09:40 -08:00
James Phillips 6cfb74d5bd
Adds -base64 support to kv get command.
Fixes #3736
2017-12-14 17:28:04 -08:00
Kyle Havlovitz 8546a1d3c6
Move autopilot to a standalone package 2017-12-11 16:45:33 -08:00
James Phillips 8fb08c7ede
Adds a registry mechanism for CLI commands. 2017-11-29 18:36:52 -08:00
Kyle Havlovitz fb464a8c0d
Fix a panic in snapshot inspect command 2017-10-30 14:51:08 -07:00
Frank Schroeder 1dab004335
Decouple the code that executes checks from the agent 2017-10-25 11:18:07 +02:00
Frank Schroeder a57e5acbf2
agent: fix TestRetryJoin 2017-10-24 20:35:37 +02:00
Frank Schroeder f398fe83b7
agent: fix TestRetryJoinFail 2017-10-24 20:35:37 +02:00
Frank Schroeder 8defdddf31
agent: fix TestRetryJoinWanFail 2017-10-24 20:35:36 +02:00
Frank Schroeder c624c72d5c
config: return error on extra command line arguments (#3397)
The `consul agent` command was ignoring extra command line arguments
which can lead to confusion when the user has for example forgotten to
add a dash in front of an argument or is not using an `=` when setting
boolean flags to `true`. `-bootstrap true` is not the same as
`-bootstrap=true`, for example.

Since all command line flags are known and we don't expect unparsed
arguments we can return an error. However, this may make it slightly
more difficult in the future if we ever wanted to have these kinds of
arguments.

Fixes #3397
2017-10-23 08:07:48 +02:00
James Phillips 60af465b4e
Updates documentation for consul validate.
This makes it clear that you need to pass the full configuration,
and that the command won't work with config fragments.

Closes #3591
2017-10-19 18:59:05 -07:00
Frank Schroeder 3a5ac6f7cc
commands: add shorter helper vars to keep fmt sane 2017-10-18 02:39:10 +02:00
Frank Schroeder 4f6abf1e72
commands: cleanup init 2017-10-18 02:39:10 +02:00
Frank Schroeder 8f58a603ea commands: get HTTP API flags for usage automatically 2017-10-18 00:08:45 +02:00
Frank Schroeder cb8faa3559 commands: drop http server flags from reload command 2017-10-18 00:08:45 +02:00
Frank Schroeder a00f8721fb commands: drop http server flags from leave command 2017-10-18 00:08:45 +02:00
Frank Schroeder c877b3001b commands: drop http server flags from keyring command 2017-10-18 00:08:45 +02:00
Frank Schroeder 6032fe1407 commands: drop http server flags from force-leave command 2017-10-18 00:08:45 +02:00
Frank Schroeder c10885f828 commands: run all tests in parallel (again) 2017-10-18 00:08:45 +02:00
Frank Schroeder efab66e616 commands: cleanup help and synopsis.
* move Help and Synopsis to bottom
* make help and synopsis constants
* make sure help output is formatted
2017-10-18 00:08:45 +02:00
Frank Schroeder a3a805d7b8 commands: do not run cmd tests in parallel
Package level parallelization is sufficient.
2017-10-18 00:08:45 +02:00
Frank Schroeder a1a1a6971d commands: add missing noTabs test 2017-10-18 00:08:45 +02:00
Frank Schroeder a6d912adb4 commands: cleanup test names 2017-10-18 00:08:45 +02:00
Frank Schroeder 0e059248e7 commands: cleanup catalog list services tests 2017-10-18 00:08:45 +02:00
Frank Schroeder 915034da78 commands: cleanup catalog list nodes tests 2017-10-18 00:08:45 +02:00
Frank Schroeder 7d7281ab54 commands: simplify import names 2017-10-18 00:08:45 +02:00
Frank Schroeder 5a34eb1e52 commands: move operator subcommands to subdirs 2017-10-18 00:08:45 +02:00
Frank Schroeder f09f6f2ec2 commands: move kv subcommands to subdirs 2017-10-18 00:08:45 +02:00
Frank Schroeder 0a9478b1f1 commands: move catalog subcommands to subdirs 2017-10-18 00:08:45 +02:00
Frank Schroeder abd7c73627 commands: move snapshot subcommands to subdirs 2017-10-18 00:08:45 +02:00
Frank Schroeder 0fb4ea3a30 commands: simplify commands.go 2017-10-18 00:08:45 +02:00
Frank Schroeder 639bf6d8ec commands: drop base command and utils 2017-10-18 00:08:45 +02:00
Frank Schroeder a0b017d976 commands: move agent command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 127bd3d295 commands: move watch command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 3f7cfca203 add token and addr to http flags 2017-10-18 00:08:45 +02:00
Frank Schroeder 6998d82be5 commands: move snapshot save command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 3a16c93eab commands: move snapshot restore command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 758199813b commands: move version command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 776cffa33d commands: move snapshot inspect command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 8724aece07 commands: move snapshot command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 602e896fb9 commands: move rtt command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 1ba816b0ae commands: move reload command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder eb0640efd0 commands: move operator autopilot set command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 3dd4841b36 commands: move operator autopilot get command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 393bf50e71 commands: move operator autopilot command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder c024fcaaa5 commands: move operator list remove-peer command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 6850c8723f commands: move operator raft list-peers command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 78aa062990 commands: move operator raft command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder fe84af448b commands: move operator command to separate pkg 2017-10-18 00:08:45 +02:00
Preetha Appan 684362b1d0 Move monitor command to its own package 2017-10-18 00:08:45 +02:00
Preetha Appan 28490d6dcb Fix import order 2017-10-18 00:08:45 +02:00
Preetha Appan 4fa3987bdc Move members command to its own package 2017-10-18 00:08:45 +02:00
Preetha Appan 8d2e6f10c7 Move maint command to its own package 2017-10-18 00:08:45 +02:00
Preetha Appan 4b06c971d2 Move lock command to its own package 2017-10-18 00:08:45 +02:00
Preetha Appan e1935590b1 Fix leave and validate commands to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 3c4363389e Fix KV CLI subcommands to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 75ec8a29a3 Fix Keyring and keygen commands to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan b8dd539037 Fix join command to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 0e1ee70a5e Fix up info and forceleave to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 95053297a9 s/initFlags/init/g 2017-10-18 00:08:45 +02:00
Preetha Appan 0cb1c92977 Fix exec and event commands to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 3bd4b738c0 Fix up catalog list services to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 8761232b2a Fix up list datacenters to build help string in constructor 2017-10-18 00:08:45 +02:00
Preetha Appan 5473dbc5a4 Fix tests by calling initFlags for each test case to reset state. 2017-10-18 00:08:45 +02:00
Preetha Appan 75ecc6a86e Better name for usage string and moving constant definition down 2017-10-18 00:08:45 +02:00
Preetha Appan 7898780106 Construct the help string in constructor using helper function. 2017-10-18 00:08:45 +02:00
Frank Schroeder 9825b6709a commands: move catalog list services to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 33a4e997b4 commands: move catalog list nodes command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder cfd110395b commands: move catalog list datacenters command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder bcf53b98d1 commands: move catalog command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 5d75449419 commands: move leave command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder ffb747a744 commands: move force-leave command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 41f13de7f5 commands: move keyring command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder b1dac89b95 commands: move kv put command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder e50c8d8f73 commands: move kv get command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 19f2dab416 commands: move kv import command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 3f0c61666d commands: move export entry struct to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 215cda4775 commands: move kv export command to separate pkg 2017-10-18 00:08:45 +02:00
Frank Schroeder 926aa72246 commands: move kv delete command to separate pkg 2017-10-18 00:08:45 +02:00