Deprecate distinct_entities and nont_entity_tokens (#27830)

* OSS Changes

* Added changelog

* Fix build errors
This commit is contained in:
divyaac
2024-07-23 13:57:38 -07:00
committed by GitHub
parent 74d15e3d50
commit b32231a9eb
6 changed files with 28 additions and 48 deletions

View File

@@ -132,7 +132,7 @@ func (c *OperatorUsageCommand) Run(args []string) int {
c.outputTimestamps(resp.Data)
out := []string{
"Namespace path | Distinct entities | Non-Entity tokens | Secret syncs | ACME clients | Active clients",
"Namespace path | Entity Clients | Non-Entity clients | Secret syncs | ACME clients | Active clients",
}
out = append(out, c.namespacesOutput(resp.Data)...)
@@ -233,14 +233,14 @@ func (c *OperatorUsageCommand) parseNamespaceCount(rawVal interface{}) (UsageRes
return ret, errors.New("missing counts")
}
ret.entityCount, ok = jsonNumberOK(counts, "distinct_entities")
ret.entityCount, ok = jsonNumberOK(counts, "entity_clients")
if !ok {
return ret, errors.New("missing distinct_entities")
return ret, errors.New("missing entity_clients")
}
ret.tokenCount, ok = jsonNumberOK(counts, "non_entity_tokens")
ret.tokenCount, ok = jsonNumberOK(counts, "non_entity_clients")
if !ok {
return ret, errors.New("missing non_entity_tokens")
return ret, errors.New("missing non_entity_clients")
}
// don't error if the secret syncs key is missing
@@ -311,15 +311,15 @@ func (c *OperatorUsageCommand) totalOutput(data map[string]interface{}) []string
return out
}
entityCount, ok := jsonNumberOK(total, "distinct_entities")
entityCount, ok := jsonNumberOK(total, "entity_clients")
if !ok {
c.UI.Error("missing distinct_entities in total")
c.UI.Error("missing entity_clients in total")
return out
}
tokenCount, ok := jsonNumberOK(total, "non_entity_tokens")
tokenCount, ok := jsonNumberOK(total, "non_entity_clients")
if !ok {
c.UI.Error("missing non_entity_tokens in total")
c.UI.Error("missing non_entity_clients in total")
return out
}
// don't error if secret syncs key is missing