Browse Source

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

Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
pull/4000/head
Maksim Nabokikh 1 year ago committed by GitHub
parent
commit
a4449010a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      storage/kubernetes/storage.go

2
storage/kubernetes/storage.go

@ -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 {

Loading…
Cancel
Save