diff options
author | 2021-08-01 21:01:44 +0200 | |
---|---|---|
committer | 2021-08-02 22:48:48 +0200 | |
commit | 5e27642926c9967a26eef5d4625aba2f1eee2c8c (patch) | |
tree | 9689affa97005d0eceb026432f6872744fcdc282 /src/k8splugin/internal/app/client.go | |
parent | e42203ee6c170eebb9466ee82baa97f83e88955c (diff) |
Add suport for query api on root level
Add suport for query api on root level. Instance
query handler and root query handler merged.
Issue-ID: MULTICLOUD-1379
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I1dc95c7aca0e734edf5794e7c36143dc12070f2b
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 } |