k8s storage: Request only one object to check if API exists (#4027)

Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
This commit is contained in:
Maksim Nabokikh
2025-03-06 11:55:34 +01:00
committed by GitHub
parent d6d0f29ab7
commit a4449010a4
+1 -1
View File
@@ -156,7 +156,7 @@ func (cli *client) registerCustomResources() (ok bool) {
r := definitions[i]
var i interface{}
cli.logger.Info("checking if custom resource has already been created...", "object", r.ObjectMeta.Name)
if err := cli.list(r.Spec.Names.Plural, &i); err == nil {
if err := cli.listN(r.Spec.Names.Plural, &i, 1); err == nil {
cli.logger.Info("the custom resource already available, skipping create", "object", r.ObjectMeta.Name)
continue
} else {