Use Kubernetes Client instead of Controller APIs from CLI (#2605)

Use the Kubernetes and Fission Client from CLI instead of Controller API.
This removes port-forwarding for the controller across Fission CLI mostly.

* Use configurable client in CLI
* Move resource namespace under cmd client
* use server to get fission version
* get archive with URL

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
neha_gupta
2022-11-07 21:42:39 +05:30
committed by GitHub
co-authored by Sanket Sudake
parent 261bf24974
commit b71a36dc1c
86 changed files with 1115 additions and 978 deletions
+15
View File
@@ -185,6 +185,21 @@ func (c *Client) Download(ctx context.Context, id string, filePath string) error
return nil
}
// Download fetches the file identified by ID to the local file path.
// filePath must not exist.
func (c *Client) GetFile(ctx context.Context, id string) (resp *http.Response, err error) {
// url for id
url := c.GetUrl(id)
// make request
resp, err = ctxhttp.Get(ctx, c.httpClient, url)
if err != nil {
return resp, err
}
return resp, err
}
func (c *Client) Delete(ctx context.Context, id string) error {
url := c.GetUrl(id)