fix(cloudmon): sync cloudproviders (#21733)

This commit is contained in:
屈轩
2024-12-04 09:42:41 +08:00
committed by GitHub
parent d5469ae918
commit 6bcee5cbed
+11 -3
View File
@@ -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"
}