Skip to content

Commit

Permalink
feat: Updated sqladmin implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
1101-1 committed Jun 4, 2024
1 parent 681998d commit fecb237
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugins/gcp/fix_plugin_gcp/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def collect(self) -> None:
for node, data in list(self.graph.nodes(data=True)):
if isinstance(node, GcpResource):
node.connect_in_graph(global_builder, data.get("source", {}))
global_builder.executor.wait_for_submitted_work()

# remove unconnected nodes
self.remove_unconnected_nodes()
Expand Down
6 changes: 3 additions & 3 deletions plugins/gcp/fix_plugin_gcp/resources/sqladmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from fix_plugin_gcp.resources.base import GcpResource, GcpDeprecationStatus, GraphBuilder
from fix_plugin_gcp.resources.compute import GcpSslCertificate
from fixlib.baseresources import BaseDatabase, ModelReference
from fixlib.json_bender import Bender, S, Bend, ForallBend, K
from fixlib.json_bender import F, Bender, S, Bend, ForallBend, K
from fixlib.types import Json

log = logging.getLogger("fix.plugins.gcp")
Expand Down Expand Up @@ -700,10 +700,10 @@ class GcpSqlDatabaseInstance(GcpResource, BaseDatabase):
"settings": S("settings", default={}) >> Bend(GcpSqlSettings.mapping),
"sql_database_instance_state": S("state"),
"suspension_reason": S("suspensionReason", default=[]),
"db_type": S("backendType"),
"db_type": S("databaseVersion") >> F(lambda db_version: db_version.split("_")[0].lower()),
"db_status": S("state"),
"db_version": S("databaseVersion"),
"volume_size": S("currentDiskSize"),
"volume_size": S("settings", "dataDiskSizeGb") >> F(int),
}
available_maintenance_versions: Optional[List[str]] = field(default=None)
backend_type: Optional[str] = field(default=None)
Expand Down

0 comments on commit fecb237

Please sign in to comment.