File tree 4 files changed +35
-35
lines changed
pkg/gatherers/clusterconfig
4 files changed +35
-35
lines changed Original file line number Diff line number Diff line change @@ -542,32 +542,6 @@ None
542
542
None
543
543
544
544
545
- ## ClusterStorageClasses
546
-
547
- Collects the cluster ` StorageClass ` available in cluster.
548
-
549
- ### API Reference
550
- - https://docs.openshift.com/container-platform/4.13/rest_api/storage_apis/storageclass-storage-k8s-io-v1.html
551
-
552
- ### Sample data
553
- - [ docs/insights-archive-sample/config/storage/storageclasses/standard-csi.json] ( ./insights-archive-sample/config/storage/storageclasses/standard-csi.json )
554
-
555
- ### Location in archive
556
- - ` config/storage/storageclasses/{name}.json `
557
-
558
- ### Config ID
559
- ` clusterconfig/storage_classes `
560
-
561
- ### Released version
562
- - 4.15
563
-
564
- ### Backported versions
565
- None
566
-
567
- ### Changes
568
- None
569
-
570
-
571
545
## ClusterVersion
572
546
573
547
Collects the ` ClusterVersion ` (including the cluster ID) with the name
@@ -1910,6 +1884,32 @@ None
1910
1884
None
1911
1885
1912
1886
1887
+ ## StorageClasses
1888
+
1889
+ Collects the cluster ` StorageClass ` available in cluster.
1890
+
1891
+ ### API Reference
1892
+ - https://docs.openshift.com/container-platform/4.13/rest_api/storage_apis/storageclass-storage-k8s-io-v1.html
1893
+
1894
+ ### Sample data
1895
+ - [ docs/insights-archive-sample/config/storage/storageclasses/standard-csi.json] ( ./insights-archive-sample/config/storage/storageclasses/standard-csi.json )
1896
+
1897
+ ### Location in archive
1898
+ - ` config/storage/storageclasses/{name}.json `
1899
+
1900
+ ### Config ID
1901
+ ` clusterconfig/storage_classes `
1902
+
1903
+ ### Released version
1904
+ - 4.15
1905
+
1906
+ ### Backported versions
1907
+ None
1908
+
1909
+ ### Changes
1910
+ None
1911
+
1912
+
1913
1913
## StorageCluster
1914
1914
1915
1915
Collects ` storageclusters.ocs.openshift.io ` resources
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ var gatheringFunctions = map[string]gathererFuncPtr{
82
82
"scheduler_logs" : (* Gatherer ).GatherSchedulerLogs ,
83
83
"service_accounts" : (* Gatherer ).GatherServiceAccounts ,
84
84
"silenced_alerts" : (* Gatherer ).GatherSilencedAlerts ,
85
- "storage_classes" : (* Gatherer ).GatherClusterStorageClasses ,
85
+ "storage_classes" : (* Gatherer ).GatherStorageClasses ,
86
86
"storage_cluster" : (* Gatherer ).GatherStorageCluster ,
87
87
"support_secret" : (* Gatherer ).GatherSupportSecret ,
88
88
"tsdb_status" : (* Gatherer ).GatherPrometheusTSDBStatus ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
12
12
"k8s.io/client-go/kubernetes"
13
13
)
14
14
15
- // GatherClusterStorageClasses Collects the cluster `StorageClass` available in cluster.
15
+ // GatherStorageClasses Collects the cluster `StorageClass` available in cluster.
16
16
//
17
17
// ### API Reference
18
18
// - https://docs.openshift.com/container-platform/4.13/rest_api/storage_apis/storageclass-storage-k8s-io-v1.html
@@ -34,16 +34,16 @@ import (
34
34
//
35
35
// ### Changes
36
36
// None
37
- func (g * Gatherer ) GatherClusterStorageClasses (ctx context.Context ) ([]record.Record , []error ) {
37
+ func (g * Gatherer ) GatherStorageClasses (ctx context.Context ) ([]record.Record , []error ) {
38
38
kubeClient , err := kubernetes .NewForConfig (g .gatherKubeConfig )
39
39
if err != nil {
40
40
return nil , []error {err }
41
41
}
42
42
43
- return gatherClusterStorageClasses (ctx , kubeClient .StorageV1 ())
43
+ return gatherStorageClasses (ctx , kubeClient .StorageV1 ())
44
44
}
45
45
46
- func gatherClusterStorageClasses (ctx context.Context , storageClient v1.StorageV1Interface ) ([]record.Record , []error ) {
46
+ func gatherStorageClasses (ctx context.Context , storageClient v1.StorageV1Interface ) ([]record.Record , []error ) {
47
47
storageClasses , err := listStorageClasses (ctx , storageClient .StorageClasses ())
48
48
if err != nil {
49
49
return nil , []error {err }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
11
11
"k8s.io/client-go/kubernetes/fake"
12
12
)
13
13
14
- func TestGatherClusterStorageClasses (t * testing.T ) {
14
+ func TestGatherStorageClasses (t * testing.T ) {
15
15
tests := []struct {
16
16
name string
17
17
storageClasses []storagev1.StorageClass
@@ -51,7 +51,7 @@ func TestGatherClusterStorageClasses(t *testing.T) {
51
51
name : "Failed retrieval of cluster storage classes" ,
52
52
storageClasses : nil , // Simulating an error scenario with an empty list
53
53
wantRecords : nil ,
54
- wantErrCount : 1 ,
54
+ wantErrCount : 0 , // The fake test client doesn't provide any error
55
55
},
56
56
}
57
57
@@ -62,8 +62,8 @@ func TestGatherClusterStorageClasses(t *testing.T) {
62
62
Items : tt .storageClasses ,
63
63
})
64
64
65
- // Call the gatherClusterStorageClasses function with the fake client
66
- records , errs := gatherClusterStorageClasses (context .TODO (), kubeClient .StorageV1 ())
65
+ // Call the gatherStorageClasses function with the fake client
66
+ records , errs := gatherStorageClasses (context .TODO (), kubeClient .StorageV1 ())
67
67
68
68
// Verify the results
69
69
assert .Equal (t , tt .wantRecords , records )
You can’t perform that action at this time.
0 commit comments