diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-08-02 22:21:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-08-02 22:21:17 +0000 |
commit | c4a7cfb5632faf61b14f41fdcfc33d89dddd0050 (patch) | |
tree | d73d65b30f9fb365444ae31a4c42e0d621c1730a /src/k8splugin/internal/app/client.go | |
parent | 91fe5c50c2d882a5c831dd473d8db765b2dd8699 (diff) | |
parent | 5e27642926c9967a26eef5d4625aba2f1eee2c8c (diff) |
Merge "Add suport for query api on root level"
Diffstat (limited to 'src/k8splugin/internal/app/client.go')
-rw-r--r-- | src/k8splugin/internal/app/client.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/k8splugin/internal/app/client.go b/src/k8splugin/internal/app/client.go index 00fd8e97..4c5f7e1c 100644 --- a/src/k8splugin/internal/app/client.go +++ b/src/k8splugin/internal/app/client.go @@ -1,6 +1,7 @@ /* Copyright 2018 Intel Corporation. Copyright © 2021 Samsung Electronics +Copyright © 2021 Orange Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -121,9 +122,11 @@ func (k *KubernetesClient) queryResources(apiVersion, kind, labelSelector, names return nil, pkgerrors.Wrap(err, "Querying for resources") } - resp := make([]ResourceStatus, len(unstrList.Items)) + resp := make([]ResourceStatus, 0) for _, unstr := range unstrList.Items { - resp = append(resp, ResourceStatus{unstr.GetName(), gvk, unstr}) + if unstr.GetName() != "" { + resp = append(resp, ResourceStatus{unstr.GetName(), gvk, unstr}) + } } return resp, nil } |