mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): azure account read only
This commit is contained in:
@@ -156,6 +156,8 @@ const (
|
||||
QCLOUD_DBINSTANCE_STORAGE_TYPE_LOCAL_SSD = "local_ssd" //本地盘SSD盘
|
||||
QCLOUD_DBINSTANCE_STORAGE_TYPE_CLOUD_SSD = "cloud_ssd" //SSD云盘
|
||||
|
||||
// Azure
|
||||
AZURE_DBINSTANCE_STORAGE_TYPE_DEFAULT = "default"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -161,7 +161,7 @@ func (self *SAzureClient) getClient(resource TAzureResource) (*autorest.Client,
|
||||
transport, _ := httpClient.Transport.(*http.Transport)
|
||||
httpClient.Transport = cloudprovider.GetCheckTransport(transport, func(req *http.Request) (func(resp *http.Response), error) {
|
||||
if self.cpcfg.ReadOnly {
|
||||
if req.Method == "GET" {
|
||||
if req.Method == "GET" || (req.Method == "POST" && strings.HasSuffix(req.URL.Path, "oauth2/token")) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.Wrapf(cloudprovider.ErrAccountReadOnly, "%s %s", req.Method, req.URL.Path)
|
||||
|
||||
@@ -142,7 +142,7 @@ func (self *SSQLServer) GetStatus() string {
|
||||
}
|
||||
|
||||
func (self *SSQLServer) GetStorageType() string {
|
||||
return ""
|
||||
return api.AZURE_DBINSTANCE_STORAGE_TYPE_DEFAULT
|
||||
}
|
||||
|
||||
func (self *SSQLServer) fetchDatabase() ([]SSQLServerDatabase, error) {
|
||||
|
||||
Reference in New Issue
Block a user