summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2021-03-09 15:57:37 +0100
committerKonrad Bańka <k.banka@samsung.com>2021-03-09 15:57:37 +0100
commitb00a7930a27afed7ba2576378aeecc75fb0759f3 (patch)
treea856508c4486e937fc4287e1f0ae4fdbec03543b /src/k8splugin/internal/app
parent5a382efb6d44399190c63d9d39dbc25069f74f61 (diff)
Correct Query API endpoint registration
Apart from corrections, corrected handling of name-only query requests as well as provided bunch of UTs. Issue-ID: MULTICLOUD-1307 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: Ida3d3e434525f323bd8c40ddc7ffd58df9c5e831
Diffstat (limited to 'src/k8splugin/internal/app')
-rw-r--r--src/k8splugin/internal/app/instance.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/k8splugin/internal/app/instance.go b/src/k8splugin/internal/app/instance.go
index 337ce687..b90a6428 100644
--- a/src/k8splugin/internal/app/instance.go
+++ b/src/k8splugin/internal/app/instance.go
@@ -22,6 +22,7 @@ import (
"log"
"strings"
+ "k8s.io/apimachinery/pkg/runtime/schema"
protorelease "k8s.io/helm/pkg/proto/hapi/release"
"github.com/onap/multicloud-k8s/src/k8splugin/internal/db"
@@ -259,7 +260,10 @@ func (v *InstanceClient) Query(id, apiVersion, kind, name, labels string) (Insta
resourcesStatus = resList
}
} else if name != "" {
- resIdentifier := helm.KubernetesResource{}
+ resIdentifier := helm.KubernetesResource{
+ Name: name,
+ GVK: schema.FromAPIVersionAndKind(apiVersion, kind),
+ }
res, err := k8sClient.getResourceStatus(resIdentifier, resResp.Namespace)
if err != nil {
return InstanceStatus{}, pkgerrors.Wrap(err, "Querying Resource")