From 4c4b574d0704a8035a3a7a673f8e5ca5e94c15e9 Mon Sep 17 00:00:00 2001 From: soharab-ic <156293296+soharab-ic@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:36:35 +0530 Subject: [PATCH] Fix fission-cli cmd `pkg getdeploy` (#2960) ``` If deployment archive is empty then command will return source archive. Deployment can be empty if pkg build failed or in running state. ``` Signed-off-by: Md Soharab Ansari --- pkg/fission-cli/cmd/package/get.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/fission-cli/cmd/package/get.go b/pkg/fission-cli/cmd/package/get.go index 31be35fc..1f42bfb9 100644 --- a/pkg/fission-cli/cmd/package/get.go +++ b/pkg/fission-cli/cmd/package/get.go @@ -71,7 +71,6 @@ func (opts *GetSubCommand) complete(input cli.Input) (err error) { } func (opts *GetSubCommand) run(input cli.Input) error { - pkg, err := opts.Client().FissionClientSet.CoreV1().Packages(opts.namespace).Get(input.Context(), opts.name, metav1.GetOptions{}) if err != nil { return err @@ -79,7 +78,7 @@ func (opts *GetSubCommand) run(input cli.Input) error { var reader io.Reader archive := pkg.Spec.Source - if opts.archiveType == util.DEPLOY_ARCHIVE || archive.Type == "" { + if (opts.archiveType == util.DEPLOY_ARCHIVE || archive.Type == "") && (pkg.Spec.Deployment.Type != "") { archive = pkg.Spec.Deployment }