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:
co-authored by
Sanket Sudake
parent
261bf24974
commit
b71a36dc1c
@@ -38,10 +38,9 @@ func GetURL(input cli.Input) error {
|
||||
|
||||
func (opts *GetURLSubCommand) do(input cli.Input) error {
|
||||
|
||||
kubeContext := input.String(flagkey.KubeContext)
|
||||
archiveID := input.String(flagkey.ArchiveID)
|
||||
|
||||
serverURL, err := util.GetStorageURL(input.Context(), kubeContext)
|
||||
serverURL, err := util.GetStorageURL(input.Context(), opts.Client())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -67,7 +66,7 @@ func (opts *GetURLSubCommand) do(input cli.Input) error {
|
||||
storageType := resp.Header.Get("X-FISSION-STORAGETYPE")
|
||||
|
||||
if storageType == "local" {
|
||||
storageSvc, err := opts.Client().V1().Misc().GetSvcURL("application=fission-storage")
|
||||
storageSvc, err := util.GetSvcName(input.Context(), opts.Client().KubernetesClient, "fission-storage")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user