mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-25 10:16:12 +08:00
fix(cloudmon): sync cloudproviders (#21733)
This commit is contained in:
@@ -157,7 +157,9 @@ func (self *SBaseResources) increment(ctx context.Context) error {
|
||||
"order_by.1": "imported_at",
|
||||
"order": "asc",
|
||||
"filter.0": timeFilter,
|
||||
"filter.1": "external_id.isnotempty()",
|
||||
}
|
||||
if self.manager.GetKeyword() != compute.Cloudproviders.GetKeyword() {
|
||||
query["filter.1"] = "external_id.isnotempty()"
|
||||
}
|
||||
if self.manager.GetKeyword() == compute.Hosts.GetKeyword() {
|
||||
query["cloud_env"] = "private_or_onpremise"
|
||||
@@ -220,8 +222,11 @@ func (self *SBaseResources) decrement(ctx context.Context) error {
|
||||
"delete": "all",
|
||||
"@deleted": "true",
|
||||
"filter.0": timeFilter,
|
||||
"filter.1": "external_id.isnotempty()",
|
||||
}
|
||||
if self.manager.GetKeyword() != compute.Cloudproviders.GetKeyword() {
|
||||
query["filter.1"] = "external_id.isnotempty()"
|
||||
}
|
||||
|
||||
if self.manager.GetKeyword() == compute.Hosts.GetKeyword() {
|
||||
query["cloud_env"] = "private_or_onpremise"
|
||||
}
|
||||
@@ -279,8 +284,11 @@ func (self *SBaseResources) update(ctx context.Context) error {
|
||||
"order": "asc",
|
||||
"pending_delete": "all",
|
||||
"filter.0": timeFilter,
|
||||
"filter.1": "external_id.isnotempty()",
|
||||
}
|
||||
if self.manager.GetKeyword() != compute.Cloudproviders.GetKeyword() {
|
||||
query["filter.1"] = "external_id.isnotempty()"
|
||||
}
|
||||
|
||||
if self.manager.GetKeyword() == compute.Hosts.GetKeyword() {
|
||||
query["cloud_env"] = "private_or_onpremise"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user