Skip to content

Commit 4cedbdf

Browse files
authored
OCPBUGS-45047: Avoid to send the same error repeated N times (openshift#1043)
* Avoid to send the same error repeated N times * Fix the LokiStack gatherer documentation
1 parent d6e19a8 commit 4cedbdf

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

docs/gathered-data.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,15 +1002,15 @@ None
10021002

10031003
Collects `lokistacks.loki.grafana.com` resources.
10041004

1005-
The gatherer will collect up to 20 resources from `openshift-logging` namespace
1005+
The gatherer will collect up to 20 resources from `openshift-*` namespaces
10061006
and it will report errors if it finds a `LokiStack` resource in a different namespace
1007-
or if there are more than 20 `LokiStacks` in the `openshift-logging` namespace.
1007+
or if there are more than 20 `LokiStacks` in the `openshift-*` namespaces.
10081008

10091009
### API Reference
10101010
None
10111011

10121012
### Sample data
1013-
- [docs/insights-archive-sample/namespaces/openshift-logging/.json](./insights-archive-sample/namespaces/openshift-logging/.json)
1013+
- [docs/insights-archive-sample/namespaces/openshift-logging/lokistack-sample.json](./insights-archive-sample/namespaces/openshift-logging/lokistack-sample.json)
10141014

10151015
### Location in archive
10161016
- `namespace/{namespace}/loki.grafana.com/lokistacks/{name}.json`
@@ -1019,7 +1019,7 @@ None
10191019
`clusterconfig/lokistacks
10201020

10211021
### Released version
1022-
- 4.18.0
1022+
- 4.19.0
10231023

10241024
### Backported versions
10251025
None
@@ -1631,7 +1631,7 @@ resources from all namespaces
16311631
None
16321632

16331633
### Sample data
1634-
- [docs/insights-archive-sample/namespaces/openstack/dataplane.openstack.org/openstackdataplanenodesets/openstack-edpm-ipam.json](./insights-archive-sample/namespaces/openstack/dataplane.openstack.org/openstackdataplanenodesets/openstack-edpm-ipam.json)
1634+
- [docs/insights-archive-sample/namespaces/openstack/dataplane.openstack.org/openstackdataplanenodesets/openstack-edpm.json](./insights-archive-sample/namespaces/openstack/dataplane.openstack.org/openstackdataplanenodesets/openstack-edpm.json)
16351635

16361636
### Location in archive
16371637
- `namespaces/{namespace}/dataplane.openstack.org/openstackdataplanes/{name}.json`
@@ -1655,7 +1655,7 @@ resources from all namespaces
16551655
None
16561656

16571657
### Sample data
1658-
- [docs/insights-archive-sample/namespaces/openstack/core.openstack.org/openstackversions/openstack-galera-network-isolation.json](./insights-archive-sample/namespaces/openstack/core.openstack.org/openstackversions/openstack-galera-network-isolation.json)
1658+
- [docs/insights-archive-sample/namespaces/openstack/core.openstack.org/openstackversion/openstack-galera-network-isolation.json](./insights-archive-sample/namespaces/openstack/core.openstack.org/openstackversion/openstack-galera-network-isolation.json)
16591659

16601660
### Location in archive
16611661
- `namespaces/{namespace}/core.openstack.org/openstackversion/{name}.json`
@@ -2094,5 +2094,6 @@ None
20942094

20952095
### Changes
20962096
- Image repository is now collected if it comes from outside the Red Hat domain
2097+
- [Tech Preview] runtime info for workloads are collected (since 4.18.0)
20972098

20982099

pkg/gatherers/clusterconfig/gather_lokistack.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ const lokiStackResourceLimit = 20
2121

2222
// GatherLokiStack Collects `lokistacks.loki.grafana.com` resources.
2323
//
24-
// The gatherer will collect up to 20 resources from `openshift-logging` namespace
24+
// The gatherer will collect up to 20 resources from `openshift-*` namespaces
2525
// and it will report errors if it finds a `LokiStack` resource in a different namespace
26-
// or if there are more than 20 `LokiStacks` in the `openshift-logging` namespace.
26+
// or if there are more than 20 `LokiStacks` in the `openshift-*` namespaces.
2727
//
2828
// ### API Reference
2929
// None
3030
//
3131
// ### Sample data
32-
// - docs/insights-archive-sample/namespaces/openshift-logging/.json
32+
// - docs/insights-archive-sample/namespaces/openshift-logging/lokistack-sample.json
3333
//
3434
// ### Location in archive
35-
// - `namespace/openshift-logging/loki.grafana.com/lokistacks/{name}.json`
35+
// - `namespace/{namespace}/loki.grafana.com/lokistacks/{name}.json`
3636
//
3737
// ### Config ID
3838
// `clusterconfig/lokistacks
3939
//
4040
// ### Released version
41-
// - 4.18.0
41+
// - 4.19.0
4242
//
4343
// ### Backported versions
4444
// None
@@ -87,6 +87,7 @@ func gatherLokiStack(ctx context.Context, dynamicClient dynamic.Interface) ([]re
8787

8888
if len(records) >= lokiStackResourceLimit {
8989
if !tooManyResourcesError {
90+
tooManyResourcesError = true
9091
errs = append(errs, fmt.Errorf(
9192
"found %d resources, limit (%d) reached",
9293
len(loggingResourceList.Items), lokiStackResourceLimit),

0 commit comments

Comments
 (0)