From 91acc37e25065bb760a83ff2dbe354ed5775c409 Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Sat, 8 Oct 2022 00:45:00 +0530 Subject: [PATCH] Allow optional VK in CR metrics Allow optional VK in CR metrics, while only requiring the group to be fixed. This would allow users to define custom metrics for: * a specific API version: version is fixed, kind varies. * all the API versions of a resource: version varies, kind is fixed. * all the APIs part of an API group: version varies, kind varies. Signed-off-by: Pranshu Srivastava --- pkg/customresourcestate/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/customresourcestate/config.go b/pkg/customresourcestate/config.go index 76e7786763..ef4b5298c6 100644 --- a/pkg/customresourcestate/config.go +++ b/pkg/customresourcestate/config.go @@ -161,6 +161,11 @@ type ConfigDecoder interface { Decode(v interface{}) (err error) } +// generateResources generates the set of possible resources from the varying V and, or K of the original config. +func generateResources(r []Resource) []Resource { + return nil +} + // FromConfig decodes a configuration source into a slice of customresource.RegistryFactory that are ready to use. func FromConfig(decoder ConfigDecoder) ([]customresource.RegistryFactory, error) { var crconfig Metrics