Zrok2 deployment fails when a dash-prefixed ziti ID is generated

In the zrok2-bootstrap file the call to zrok2_admin create frontend --dynamic "$public_ziti_id" public fails when a ziti ID starting with a - is generated. I've reproduced this consistently in a project using the docker-compose self-hosting deployment method. It seems like there is a missing escape in this bash script. Here is the exact error message:

zrok2 admin create frontend failed: Error: unknown shorthand flag: 'a' in -alx7CJrx

Good catch! By the way, @MHolmes91, Ziti 1.2.1 prevents Ziti IDs from starting with a hyphen. The latest stable 1.6 has that fix too. I assume you're on an older version of Ziti.

Problem recap: the zrok2 binary interprets an argument that represents a Ziti ID as an option if it starts with a - hyphen.

Solution: users (including scripts like zrrok2-bootstrap.bash must "tell" zrok2 when they're done sending options with the POSIX argument separator -- meaning "all further positionals are not options."

Example:

zrok2 admin create frontend --dynamic -- "-r9CVYfXW" kentest1

I've proposed some refinements in handle ziti ids starting with hyphen by qrkourier · Pull Request #1206 · openziti/zrok · GitHub, which will prevent this from surfacing when users are following the self-hosting guides, but it's still necessary for interactive users to separate non-options starting with a hyphen from actual options with -- if they're running a version of Ziti before 1.2.1.