我在 juju 中有一个 bash 钩子,它执行以下操作
list_of_relation_ids=$(relation-ids somedata)
if [ -z $list_of_relation_ids ]; then
juju-log -l 'WARNING' "list_of_relation_ids is empty"
status-set maintenance "(start) You need to relate this unit to a producer of somedata $(date +"%H:%M")"
exit
else
for relation in "$list_of_relation_ids"
do
echo $relation
echo $JUJU_UNIT_NAME
relation-get - MYUNIT
done
fi
根据juju自己的手册页...我应该能够传递关系ID..并且我的单元取回我试图检查的元数据存在于更新挂钩中..但没有任何东西被拉下来。相反,我只是收到此错误no relation id specified