notaryproject / notation-go

A collection of libraries for supporting sign and verify OCI artifacts. Based on Notary Project specifications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

invalid plugin output is not readable

JeyJeyGao opened this issue · comments

If the plugin return an error message in an invalid format, the debug log is not readable.

    time="2023-01-13T13:54:16+08:00" level=debug msg="Plugin generate-envelope returned error: VALIDATION_ERROR: ExpiryDurationInSeconds is not set"
    Error: plugin failed to sign with following error: ERROR: response is not in JSON format. error: exit status 1 stderr: [86 65 76 73 68 65 84 73 79 78 95 69 82 82 79 82 58 32 69 120 112 105 114 121 68 117 114 97 116 105 111 110 73 110 83 101 99 111 110 100 115 32 105 115 32 110 111 116 32 115 101 116]

We need to convert the stderr []byte to be string to make it more readable.