1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-03 14:07:24 +00:00

kata-deploy: Return exit code for invalid argument

It hangs when invalid arguments are specified.

```bash
kata-deploy-6sr2p:/# /opt/kata-artifacts/scripts/kata-deploy.sh xxx
Action:
* xxx
...
Usage: /opt/kata-artifacts/scripts/kata-deploy.sh [install/cleanup/reset]
ERROR: invalid arguments
...
^C <- hang
```

I changed it to behave the same as when there are no arguments.

```bash
kata-deploy-6sr2p:/# /opt/kata-artifacts/scripts/kata-deploy.sh
Usage: /opt/kata-artifacts/scripts/kata-deploy.sh [install/cleanup/reset]
ERROR: invalid arguments
kata-deploy-6sr2p:/# echo $?
1
```

Fixes: 

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
This commit is contained in:
Shunsuke Kimura 2025-03-22 21:23:44 +09:00
parent 810a6dafad
commit e5d7414c33

View File

@ -909,8 +909,8 @@ function main() {
reset_runtime $runtime reset_runtime $runtime
;; ;;
*) *)
echo invalid arguments
print_usage print_usage
die "invalid arguments"
;; ;;
esac esac
fi fi