CCE容器拉取私有镜像时报错“Auth is empty”
问题描述
在CCE的控制台界面中为已经创建的工作负载更换镜像,选择我上传的镜像,容器在拉取镜像时报错“Auth is empty, only accept X-Auth-Token or Authorization”。
Failed to pull image "IP地址:端口号/magicdoom/tidb-operator:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://IP地址:端口号/v2/magicdoom/tidb-operator/manifests/latest: error parsing HTTP 400 response body: json: cannot unmarshal number into Go struct field Error.code of type errcode.ErrorCode: "{\"errors\":[{\"code\":400,\"message\":\"Auth is empty, only accept X-Auth-Token or Authorization.\"}]}"
解答
您可以通过CCE控制台界面选择私有镜像创建应用,此时CCE会自动带上该secret,升级时不会出现该问题。
您通过API创建应用时,在deployment中带入该secret也可以在升级时避免该问题。
imagePullSecrets: - name: default-secret