mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix: service catalog nil pointer
This commit is contained in:
@@ -375,7 +375,7 @@ func (self *SIdentityProvider) CanSync() bool {
|
||||
|
||||
func (self *SIdentityProvider) getSyncIntervalSeconds() int {
|
||||
if self.SyncIntervalSeconds == 0 {
|
||||
return options.Options.DefaultSyncIntervalSeoncds
|
||||
return options.Options.DefaultSyncIntervalSeconds
|
||||
}
|
||||
return self.SyncIntervalSeconds
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ type SKeystoneOptions struct {
|
||||
|
||||
AutoSyncIntervalSeconds int `help:"frequency to check auto sync tasks" default:"30"`
|
||||
|
||||
DefaultSyncIntervalSeoncds int `help:"frequency to do auto sync tasks" default:"900"`
|
||||
DefaultSyncIntervalSeconds int `help:"frequency to do auto sync tasks" default:"900"`
|
||||
|
||||
FetchProjectResourceCountIntervalSeconds int `help:"frequency tp fetch project resource counts" default:"900"`
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ func (this *ClientSession) GetServiceVersionURL(service, endpointType, apiVersio
|
||||
}
|
||||
service = this.getServiceName(service, apiVersion)
|
||||
url, err := this.token.GetServiceURL(service, this.region, this.zone, endpointType)
|
||||
if err != nil {
|
||||
if err != nil && this.client.serviceCatalog != nil {
|
||||
url, err = this.client.serviceCatalog.GetServiceURL(service, this.region, this.zone, endpointType)
|
||||
}
|
||||
if err != nil && service == api.SERVICE_TYPE {
|
||||
@@ -161,7 +161,7 @@ func (this *ClientSession) GetServiceVersionURLs(service, endpointType, apiVersi
|
||||
}
|
||||
service = this.getServiceName(service, apiVersion)
|
||||
urls, err := this.token.GetServiceURLs(service, this.region, this.zone, endpointType)
|
||||
if err != nil {
|
||||
if err != nil && this.client.serviceCatalog != nil {
|
||||
urls, err = this.client.serviceCatalog.GetServiceURLs(service, this.region, this.zone, endpointType)
|
||||
}
|
||||
if err != nil && service == api.SERVICE_TYPE {
|
||||
|
||||
Reference in New Issue
Block a user