Skip to content
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

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

raskchanky
Copy link
Contributor

@raskchanky raskchanky added this to the 1.17.0-rc milestone Apr 18, 2024
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Apr 18, 2024
Copy link

github-actions bot commented Apr 18, 2024

CI Results:
All Go tests succeeded! ✅

Copy link

github-actions bot commented Apr 18, 2024

Build Results:
All builds succeeded! ✅

@@ -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")
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point

@@ -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")
Copy link
Contributor

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

Copy link
Contributor

@miagilepner miagilepner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@raskchanky raskchanky merged commit 75b0418 into main Apr 29, 2024
83 checks passed
@raskchanky raskchanky deleted the add-acme-to-vault-operator-usage branch April 29, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants