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 <soharab.ansari@infracloud.io>
This commit is contained in:
soharab-ic
2024-06-20 18:36:35 +05:30
committed by GitHub
parent 9b978cf2fd
commit 4c4b574d07
+1 -2
View File
@@ -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
}