summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2019-04-02 17:20:12 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-02 17:20:12 +0000
commit408200f3c402fa31fc465b5cd8b2ea4340048468 (patch)
tree8de5c58ed150e3f2339ad29b78c47dc847f624fe /src/k8splugin/api
parenta1e2fb3ff225509885f82311096d0353e1117877 (diff)
parentf3875e13c7a6675aa980c29580daae42a32eb97f (diff)
Merge "Make profile key explicit"
Diffstat (limited to 'src/k8splugin/api')
-rw-r--r--src/k8splugin/api/handler_test.go4
-rw-r--r--src/k8splugin/api/profilehandler.go2
-rw-r--r--src/k8splugin/api/profilehandler_test.go8
3 files changed, 7 insertions, 7 deletions
diff --git a/src/k8splugin/api/handler_test.go b/src/k8splugin/api/handler_test.go
index df4d03c3..cb377ea5 100644
--- a/src/k8splugin/api/handler_test.go
+++ b/src/k8splugin/api/handler_test.go
@@ -125,7 +125,7 @@ func TestCreateHandler(t *testing.T) {
mockStore: &db.MockDB{
Items: map[string]map[string][]byte{
rb.ProfileKey{RBName: "testresourcebundle", RBVersion: "v1",
- Name: "profile1"}.String(): {
+ ProfileName: "profile1"}.String(): {
"metadata": []byte(
"{\"profile-name\":\"profile1\"," +
"\"release-name\":\"testprofilereleasename\"," +
@@ -270,7 +270,7 @@ func TestCreateHandler(t *testing.T) {
mockStore: &db.MockDB{
Items: map[string]map[string][]byte{
rb.ProfileKey{RBName: "test-rbdef", RBVersion: "v1",
- Name: "profile1"}.String(): {
+ ProfileName: "profile1"}.String(): {
"metadata": []byte(
"{\"profile-name\":\"profile1\"," +
"\"release-name\":\"testprofilereleasename\"," +
diff --git a/src/k8splugin/api/profilehandler.go b/src/k8splugin/api/profilehandler.go
index 2c15a440..362289ff 100644
--- a/src/k8splugin/api/profilehandler.go
+++ b/src/k8splugin/api/profilehandler.go
@@ -49,7 +49,7 @@ func (h rbProfileHandler) createHandler(w http.ResponseWriter, r *http.Request)
}
// Name is required.
- if p.Name == "" {
+ if p.ProfileName == "" {
http.Error(w, "Missing name in POST request", http.StatusBadRequest)
return
}
diff --git a/src/k8splugin/api/profilehandler_test.go b/src/k8splugin/api/profilehandler_test.go
index 4e346862..e6a87129 100644
--- a/src/k8splugin/api/profilehandler_test.go
+++ b/src/k8splugin/api/profilehandler_test.go
@@ -92,7 +92,7 @@ func TestRBProfileCreateHandler(t *testing.T) {
expected: rb.Profile{
RBName: "testresource_bundle_definition",
RBVersion: "v1",
- Name: "profile1",
+ ProfileName: "profile1",
ReleaseName: "testprofilereleasename",
Namespace: "default",
KubernetesVersion: "1.12.3",
@@ -103,7 +103,7 @@ func TestRBProfileCreateHandler(t *testing.T) {
{
RBName: "testresource_bundle_definition",
RBVersion: "v1",
- Name: "profile1",
+ ProfileName: "profile1",
ReleaseName: "testprofilereleasename",
Namespace: "default",
KubernetesVersion: "1.12.3",
@@ -156,7 +156,7 @@ func TestRBProfileGetHandler(t *testing.T) {
expected: rb.Profile{
RBName: "testresource_bundle_definition",
RBVersion: "v1",
- Name: "profile1",
+ ProfileName: "profile1",
ReleaseName: "testprofilereleasename",
Namespace: "default",
KubernetesVersion: "1.12.3",
@@ -168,7 +168,7 @@ func TestRBProfileGetHandler(t *testing.T) {
{
RBName: "testresource_bundle_definition",
RBVersion: "v1",
- Name: "profile1",
+ ProfileName: "profile1",
ReleaseName: "testprofilereleasename",
Namespace: "default",
KubernetesVersion: "1.12.3",