在构建触发器上使用base64编码的值时,cloudbuil.yaml不会解组 [英] cloudbuil.yaml does not unmarshall when using base64-encoded value on build trigger
问题描述
在我的cloudbuild.yaml
定义中,我曾经有一个secrets
部分来从Google KMS获取环境值. secretEnv
字段具有映射到已加密+ base64编码"值的密钥:
On my cloudbuild.yaml
definition, I used to have a secrets
section to get environment values from Google KMS. The secretEnv
fields had keys mapping to 'encrypted + base64-encoded' values:
...
secrets:
- kmsKeyName: <API_PATH>
secretEnv:
<KEY>: <ENCRYPTED+BASE64>
我尝试将此值放在替代项上,当使用构建触发器时将替换该值:
I've tried to put this value on a substitution instead, which is replaced when a build trigger is used:
...
secrets:
- kmsKeyName: <API_PATH>
secretEnv:
<KEY>: ${_VALUE}
为此,我打算保持文件的通用性.
With that I intend to keep the file generic.
但是,构建过程一直失败,并显示一条消息:无法解组构建配置cloudcloud.yaml:输入字节0处的非法base64数据.我已经检查了好几次,并且base64值没有被错误地复制到触发器的替换项中.
However, the build process keeps failing with a message failed unmarshalling build config cloudbuild.yaml: illegal base64 data at input byte 0. I've checked several times and the base64 value was not copied wrong into the substitution on the trigger.
谢谢.
推荐答案
https://cloud.google.com/cloud-build/docs/configuring-builds/substitute-variable-values
仔细阅读Using user-defined substitutions
部分后,我已经看到了
After reading Using user-defined substitutions
section carefully, I've seen that
参数键的长度限制为100个字节,并且长度 参数值的上限为4000个字节.
The length of a parameter key is limited to 100 bytes and the length of a parameter value is limited to 4000 bytes.
我的是一个253个字符的字符串.
Mine was a 253-character long string.
这篇关于在构建触发器上使用base64编码的值时,cloudbuil.yaml不会解组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!