我像这样创建了一个秘密:
kubectl create secret generic test --from-literal=username=testuser --from-literal=password=12345
我想将用户名更新为testuser2
,但我只想使用kubectl patch --type='json'
命令来做到这一点。
这是我尝试的方法:
kubectl patch secret test --type='json' -p='[{"data":{"username": "testuser 2"}}]' -v=1
但我收到了:
"" 是无效的
记住,我想使用选项 --type='json'
来完成,没有其他解决办法。