-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ACME client counts to vault operator usage #26525
Conversation
CI Results: |
Build Results: |
command/operator_usage.go
Outdated
@@ -245,6 +246,11 @@ func (c *OperatorUsageCommand) parseNamespaceCount(rawVal interface{}) (UsageRes | |||
// don't error if the secret syncs key is missing | |||
ret.secretSyncs, _ = jsonNumberOK(counts, "secret_syncs") | |||
|
|||
ret.acmeCount, ok = jsonNumberOK(counts, "acme_clients") | |||
if !ok { | |||
return ret, errors.New("missing acme_clients") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should error here - if the vault client version is greater than the vault server version, then acme_clients
might be missing from the response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point
command/operator_usage.go
Outdated
@@ -321,13 +327,19 @@ func (c *OperatorUsageCommand) totalOutput(data map[string]interface{}) []string | |||
// don't error if secret syncs key is missing | |||
secretSyncs, _ := jsonNumberOK(total, "secret_syncs") | |||
|
|||
acmeCount, ok := jsonNumberOK(total, "acme_clients") | |||
if !ok { | |||
c.UI.Error("missing acme_clients in total") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, this probably doesn't require an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
https://hashicorp.atlassian.net/browse/VAULT-24578