aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-03-11 16:32:20 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-03-11 16:53:12 -0700
commitf70a3d22ce65e9c17a99fc921d350fbcbe146332 (patch)
tree83da1f4911ca11fa410af01701e5cc3539256f10 /src/k8splugin/api
parent49a48a37a76201839c9507a970d639a318ba9d3f (diff)
Detect chart name
ChartName should not be mandatory field If not provided it will be detected by inspection of the tar.gz archive. Issue-ID: MULTICLOUD-525 Change-Id: Idaf9672f2cbbb882d78b1987467472ce73c651da Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/api')
-rw-r--r--src/k8splugin/api/defhandler.go6
-rw-r--r--src/k8splugin/api/defhandler_test.go10
2 files changed, 0 insertions, 16 deletions
diff --git a/src/k8splugin/api/defhandler.go b/src/k8splugin/api/defhandler.go
index 21e5e768..44521dd1 100644
--- a/src/k8splugin/api/defhandler.go
+++ b/src/k8splugin/api/defhandler.go
@@ -54,12 +54,6 @@ func (h rbDefinitionHandler) createHandler(w http.ResponseWriter, r *http.Reques
return
}
- // Chart Name is required
- if v.ChartName == "" {
- http.Error(w, "Missing chart name in POST request", http.StatusBadRequest)
- return
- }
-
ret, err := h.client.Create(v)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
diff --git a/src/k8splugin/api/defhandler_test.go b/src/k8splugin/api/defhandler_test.go
index 20ef537e..48e2406c 100644
--- a/src/k8splugin/api/defhandler_test.go
+++ b/src/k8splugin/api/defhandler_test.go
@@ -125,16 +125,6 @@ func TestRBDefCreateHandler(t *testing.T) {
expectedCode: http.StatusBadRequest,
rbDefClient: &mockRBDefinition{},
},
- {
- label: "Missing Chart Name in Request Body",
- reader: bytes.NewBuffer([]byte(`{
- "name":"testresourcebundle",
- "description":"test description",
- "service-type":"firewall"
- }`)),
- expectedCode: http.StatusBadRequest,
- rbDefClient: &mockRBDefinition{},
- },
}
for _, testCase := range testCases {