mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user