Skip to content

Commit

Permalink
fix: Add new managed namespace for Common
Browse files Browse the repository at this point in the history
Signed-off-by: kang2453 <[email protected]>
  • Loading branch information
kang2453 committed Dec 17, 2024
1 parent 3ee9044 commit a4e20a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/spaceone/inventory_v2/manager/namespace_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def filter_namespaces(self, **conditions) -> QuerySet:
return self.namespace_model.filter(**conditions)

def list_namespaces(self, query: dict, domain_id: str) -> Tuple[QuerySet, int]:
# self.create_managed_namespace(domain_id)
self.create_managed_namespace(domain_id)
return self.namespace_model.query(**query)

def stat_namespaces(self, query: dict) -> dict:
Expand Down
6 changes: 3 additions & 3 deletions src/spaceone/inventory_v2/service/namespace_group_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ def get(self, params: NamespaceGroupGetRequest) -> Union[NamespaceGroupResponse,
permission="inventory-v2:NamespaceGroup.read",
role_types=["DOMAIN_ADMIN", "WORKSPACE_OWNER", "WORKSPACE_MEMBER"],
)
@change_value_by_rule("APPEND", "workspace_id","*")
@append_query_filter(
[
"namespace_group_id",
"is_managed",
"workspace_id",
"domain_id",
]
)
@append_keyword_filter(["namespace_group_id", "name"])
@change_value_by_rule("APPEND", "workspace_id","*")
@convert_model
def list(
self, params: NamespaceGroupSearchQueryRequest
Expand All @@ -205,7 +205,7 @@ def list(

query = params.query or {}
namespace_group_vos, total_count = self.namespace_group_mgr.list_namespace_groups(
query, params.domain_id,
query, params.domain_id
)

namespaces_group_info = [namespace_group_vo.to_dict() for namespace_group_vo in namespace_group_vos]
Expand Down
3 changes: 2 additions & 1 deletion src/spaceone/inventory_v2/service/namespace_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,19 @@ def get(self, params: NamespaceGetRequest) -> Union[NamespaceResponse, dict]:
permission="inventory-v2:Namespace.read",
role_types=["DOMAIN_ADMIN", "WORKSPACE_OWNER", "WORKSPACE_MEMBER"],
)
@change_value_by_rule("APPEND", "workspace_id","*")
@append_query_filter(
[
"namespace_id",
"category",
"is_managed",
"resource_type",
"namespace_group_id",
"workspace_id",
"domain_id",
]
)
@append_keyword_filter(["namespace_id", "name"])
@change_value_by_rule("APPEND", "workspace_id","*")
@convert_model
def list(
self, params: NamespaceSearchQueryRequest
Expand Down

0 comments on commit a4e20a1

Please sign in to comment.