Skip to content

Commit 82f43c5

Browse files
committed
fix(customresourcestate): generate unique HELP message for each family
The family generator creates a family per GVK, this requires that the configuration has a unique HELP text per custom metric. This is not feasible when using wildcards as the generate will reuse the same HELP text for each GVK it finds.
1 parent 2e8c3bf commit 82f43c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/customresourcestate/registry_factory.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ func compileFamily(f Generator, resource Resource) (*compiledFamily, error) {
9090
if errorLogV == 0 {
9191
errorLogV = resource.ErrorLogV
9292
}
93+
94+
help := fmt.Sprintf("%s for %s/%s/%s", f.Help, resource.GroupVersionKind.Group, resource.GroupVersionKind.Version, resource.GroupVersionKind.Kind)
95+
9396
return &compiledFamily{
9497
Name: fullName(resource, f),
9598
ErrorLogV: errorLogV,
96-
Help: f.Help,
99+
Help: help,
97100
Each: metric,
98101
Labels: labels.CommonLabels,
99102
LabelFromPath: labelsFromPath,

0 commit comments

Comments
 (0)