我正在尝试使用以下方式编辑kubernetes secret :
kubectl edit secret mysecret -o yaml
并在
data
上添加一个新变量:data:
NEW_VAR: true
但我收到错误:
cannot restore slice from bool
如果我尝试使用一些数字,例如:
data:
NEW_VAR: 1
关闭编辑器后,我收到另一个错误:
cannot restore slice from int64
此错误是什么意思?
最佳答案
当变量不是有效的 base64 值时,会发生此错误。
因此,要使用true
值,您需要使用其base64表示形式:
NEW_VAR: dHJ1ZQ==
关于kubernetes - Kubernetes编辑 secret 错误: “cannot restore slice from…”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52957287/