Skip to content

Commit

Permalink
fix: fixed duplicate checksum error in sql service
Browse files Browse the repository at this point in the history
  • Loading branch information
1101-1 committed Aug 8, 2024
1 parent 3c831f8 commit d1b89b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/gcp/fix_plugin_gcp/resources/sqladmin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from datetime import datetime
from typing import ClassVar, Dict, Optional, List, Type
from typing import Any, ClassVar, Dict, Optional, List, Tuple, Type

from attr import define, field

Expand Down Expand Up @@ -1072,7 +1072,7 @@ class GcpSqlUser(GcpResource):
)
reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_sql_database_instance"]}}
mapping: ClassVar[Dict[str, Bender]] = {
"id": S("name").or_else(K("(anonymous)@") + S("host", default="localhost")),
"id": S("name").or_else(K("(anonymous)") + S("host", default="localhost")),
"tags": S("labels", default={}),
"name": S("name", default="(anonymous)"),
"ctime": S("creationTimestamp"),
Expand Down Expand Up @@ -1104,5 +1104,8 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None:
if self.instance:
builder.add_edge(self, reverse=True, clazz=GcpSqlDatabaseInstance)

def _keys(self) -> Tuple[Any, ...]:
return self.kind, self.cloud().id, self.account().id, self.region().id, self.zone().id, self.id, self.instance


resources: List[Type[GcpResource]] = [GcpSqlDatabaseInstance]

0 comments on commit d1b89b1

Please sign in to comment.