mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Fix: fix config parameter in ql (#4717)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com> Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
This commit is contained in:
@@ -128,7 +128,7 @@ func (handler *ViewHandler) QueryView(ctx context.Context, qv QueryView) (*value
|
||||
Apply: handler.dispatch,
|
||||
Delete: handler.delete,
|
||||
})
|
||||
query.Install(handlerProviders, handler.cli, nil)
|
||||
query.Install(handlerProviders, handler.cli, handler.cfg)
|
||||
loader := template.NewViewTemplateLoader(handler.cli, handler.namespace)
|
||||
if len(strings.Split(qv.View, "\n")) > 2 {
|
||||
loader = &template.EchoLoader{}
|
||||
|
||||
@@ -214,6 +214,9 @@ func decodeResponseBody(resp *http.Response, dst interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
return fmt.Errorf("response code is not 200: %d body: %s", resp.StatusCode, string(body))
|
||||
}
|
||||
if dst != nil {
|
||||
err = json.Unmarshal(body, dst)
|
||||
if err != nil {
|
||||
@@ -221,8 +224,5 @@ func decodeResponseBody(resp *http.Response, dst interface{}) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
return fmt.Errorf("response code is not 200: %d body: %s", resp.StatusCode, string(body))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -406,6 +406,7 @@ var _ = Describe("Test velaQL rest api", func() {
|
||||
Err string `json:"err,omitempty"`
|
||||
}{}
|
||||
Expect(decodeResponseBody(queryRes, status)).Should(Succeed())
|
||||
Expect(status.Logs).Should(Equal("hello-world\n"))
|
||||
})
|
||||
|
||||
It("test appliedResource and application tree velaql", func() {
|
||||
|
||||
Reference in New Issue
Block a user