mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-25 10:16:12 +08:00
Merge pull request #12745 from ioito/hotfix/qx-aliyun-kube-cluster-404
fix(region): aliyun kube cluster 404 error
This commit is contained in:
@@ -169,6 +169,13 @@ func jsonRequest(client *sdk.Client, domain, apiVersion, apiName string, params
|
||||
resp, err = _jsonRequest(client, domain, apiVersion, apiName, params)
|
||||
retry := false
|
||||
if err != nil {
|
||||
for _, code := range []string{
|
||||
"ErrorClusterNotFound",
|
||||
} {
|
||||
if strings.Contains(err.Error(), code) {
|
||||
return nil, errors.Wrap(cloudprovider.ErrNotFound, err.Error())
|
||||
}
|
||||
}
|
||||
if e, ok := errors.Cause(err).(*alierr.ServerError); ok {
|
||||
code := e.ErrorCode()
|
||||
switch code {
|
||||
|
||||
@@ -37,6 +37,15 @@ func init() {
|
||||
ID string
|
||||
}
|
||||
|
||||
shellutils.R(&KubeClusterIdOptions{}, "kube-cluster-show", "Show kube cluster", func(cli *aliyun.SRegion, args *KubeClusterIdOptions) error {
|
||||
cluster, err := cli.GetKubeCluster(args.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(cluster)
|
||||
return nil
|
||||
})
|
||||
|
||||
shellutils.R(&KubeClusterIdOptions{}, "kube-cluster-delete", "Delete kube cluster", func(cli *aliyun.SRegion, args *KubeClusterIdOptions) error {
|
||||
return cli.DeleteKubeCluster(args.ID, false)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user