zoe icon indicating copy to clipboard operation
zoe copied to clipboard

[Bug] STDIN input for `zoe schemas deploy` doesn't work

Open whatsupbros opened this issue 2 years ago • 0 comments

This is a common use-case, when a user needs to migrate a schema from one cluster to another. For this, the --from-stdin option looks ideal to be used.

The command then could look somewhat like this:

zoe --silent --cluster source_cluster schemas describe my-topic-value \
| jq -rc '.latest' \
| zoe --no-silent --cluster dest_cluster schemas deploy --from-stdin --strategy topic --topic my-topic --suffix value --avsc

But when I run such a command, I am getting this error:

2022-05-18 12:04:52 INFO zoe: stream is empty
failure: Expected at least one element

However, the output of jq command is obviously not empty.


Furthermore, if I run the command using the intermediate step to unload the schema to a file, then it works:

zoe --silent --cluster t1 schemas describe my-topic-value \
| jq -rc '.latest' > schema.json \
&& zoe --no-silent --cluster local schemas deploy --from-file schema.json --strategy topic --topic my-topic --suffix value --avsc

Feedback:

{"type":"actual","id":1,"subject":"my-topic-value"}

The only thing I changed here, is that I redirected the jq output to a file, and then used the file for the zoe schemas deploy command with --from-file option instead of --from-stdin, which is an unnecessary extra step.


zoe version print output:

{"projectVersion":"0.28.0","buildTimestamp":"2021-11-04T23:39:18.809435","createdBy":"Gradle 7.2","buildJdk":"14.0.2 (Azul Systems, Inc. 14.0.2+12)","buildOS":"Linux amd64 5.11.0-1020-azure"}

whatsupbros avatar May 18 '22 10:05 whatsupbros