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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user