forked from LaconicNetwork/kompose
fix: update match output function (#1546)
This commit is contained in:
parent
91391eb84f
commit
7304bb6013
@ -100,7 +100,7 @@ function convert::match_output() {
|
|||||||
convert::run_cmd $cmd
|
convert::run_cmd $cmd
|
||||||
exit_status=$?
|
exit_status=$?
|
||||||
if [ $exit_status -ne 0 ]; then FAIL_MSGS=$FAIL_MSGS"exit status: $exit_status\n"; return $exit_status; fi
|
if [ $exit_status -ne 0 ]; then FAIL_MSGS=$FAIL_MSGS"exit status: $exit_status\n"; return $exit_status; fi
|
||||||
match=$(diff <(yq -P 'sort_keys(....)' $expected_output) <(yq -P 'sort_keys(....)' $TEMP_STDOUT))
|
match=$(diff <(yq ea '[.] | sort_by(.metadata.name) | .[] | splitDoc' $expected_output) <(yq ea '[.] | sort_by(.metadata.name) | .[] | splitDoc' $TEMP_STDOUT))
|
||||||
echo "$match" > /tmp/diff
|
echo "$match" > /tmp/diff
|
||||||
if [ "$match" == "" ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0;
|
if [ "$match" == "" ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0;
|
||||||
else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; cat /tmp/diff; rm /tmp/diff; return 1;
|
else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; cat /tmp/diff; rm /tmp/diff; return 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user