我正在尝试使用Kubernetes Client for Go更新Openshift中的现有部署。我正在使用以下JSON将副本更新为3:
JSON:
{
"kind": "Deployment",
"spec": {
"template": {
"spec": {
"containers": {
"image": "docker.fmr.com\/fmr-pr000105\/testcontainer:1.0.0",
"name": "testcontainer",
"resources": {
"requests": {
"cpu": "50m"
},
"limits": {
"cpu": "50m",
"memory": "50M"
}
},
"ports": {
"protocol": "TCP",
"name": "test-con-http",
"containerPort": 22
}
}
},
"metadata": {
"labels": {
"app": "testcontainer"
}
}
},
"replicas": 3
},
"apiVersion": "extensions\/v1beta1",
"metadata": {
"name": "testcontainer"
}
}
Run Code Online (Sandbox Code Playgroud)
但是继续得到错误:
only encoded map or array can be decoded into a struct
Run Code Online (Sandbox Code Playgroud)
我正在使用以下代码:
import …Run Code Online (Sandbox Code Playgroud)