Skip to content

Commit

Permalink
Merge pull request #5 from stat-kwon/master
Browse files Browse the repository at this point in the history
Change yaml file of Service Account
  • Loading branch information
stat-kwon authored Apr 30, 2024
2 parents 56fe20a + 7badc54 commit bff58b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/cloudforet/plugin/manager/iam_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ def create_cloud_service(self, options, secret_data, schema):
if org_and_folder_inheritance or trusting_projects
else False,
"resourceType": self._check_resource_type(
org_and_folder_inheritance.get(
"resourceType", "PROJECT"
),
org_and_folder_inheritance.get("resourceType"),
trusting_projects,
),
"serviceAccountKeys": new_sa_keys,
Expand All @@ -189,7 +187,6 @@ def create_cloud_service(self, options, secret_data, schema):
"affectedProjectsCount": int(affected_projects_count),
"affectedProjects": affected_projects,
"projectInheritances": project_inheritances,
"view": "view",
}

self.set_region_code("global")
Expand Down Expand Up @@ -230,6 +227,8 @@ def _check_resource_type(resource_type, trusting_projects):
return "PROJECT"
elif resource_type == "ORGANIZATION":
return "ORGANIZATION"
elif resource_type == "FOLDER":
return "FOLDER"
elif trusting_projects:
return "PROJECT"
else:
Expand All @@ -251,6 +250,7 @@ def _check_project_inheritances(self, email, current_project_id, project_roles):
"projectId": target_project_id,
"projectName": display_name,
"roles": self._create_roles(roles, project_roles),
"view": "view",
}
)

Expand All @@ -275,7 +275,7 @@ def _create_project_role_binding_count_map(self, project_resource_map):
count_map[target_project_id] = {
"count": 1,
"projects_info": [project],
"resource_type": "project",
"resource_type": "PROJECT",
}
else:
count_map[target_project_id]["count"] += 1
Expand Down
34 changes: 16 additions & 18 deletions src/cloudforet/plugin/metadata/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ search:
- Inheritance Type: data.display.resourceType
type: enum
enums:
- "ORGANIZATION": blue.500
- "ORGANIZATION": coral.500
- "PROJECT": gray.500
- "FOLDER": yellow.500

Expand All @@ -32,11 +32,10 @@ table:
fields:
- Name: data.email
- Display Name: data.displayName
- Project ID: data.projectId
- Inheritance Type: data.display.resourceType
type: enum
enums:
- "ORGANIZATION": blue.500
- "ORGANIZATION": coral.500
- "PROJECT": gray.500
- "FOLDER": yellow.500
- Inheritance: data.display.inheritance
Expand All @@ -45,7 +44,7 @@ table:
- "True": green.500
- "False": red.500
- Affected Projects: data.display.affectedProjectsCount
type: integer
- Project ID: data.projectId
- Has Keys: data.display.hasKeys
type: enum
enums:
Expand All @@ -67,13 +66,12 @@ tabs.0:
name: Details
type: item
fields:
- Name: data.email
- Display Name: data.displayName
- Project ID: data.projectId
- Inheritance Type: data.display.resourceType
type: enum
enums:
- "ORGANIZATION": blue.500
- "ORGANIZATION": coral.500
- "PROJECT": gray.500
- "FOLDER": yellow.500
- Inheritance: data.display.inheritance
Expand All @@ -89,14 +87,13 @@ tabs.0:
- "True": green.500
- "False": red.500
- Active Keys: data.display.activeKeys
type: integer
- Unique ID: data.uniqueId
- Resource ID: data.name
- etag: data.etag
- Unique ID: data.uniqueId

tabs.1:
name: Inheritances
name: Organization or Folder Inheritances
items:
- name: Inheritance Information
type: item
Expand All @@ -105,7 +102,7 @@ tabs.1:
- Inheritance Type: data.display.resourceType
type: enum
enums:
- "ORGANIZATION": blue.500
- "ORGANIZATION": coral.500
- "PROJECT": gray.500
- "FOLDER": yellow.500
- name: Roles
Expand All @@ -116,32 +113,33 @@ tabs.1:
- Type: type
type: enum
enums:
- "ORGANIZATION ROLE": blue.500
- "ORGANIZATION ROLE": coral.500
- "PROJECT ROLE": gray.500
- "MANAGED ROLE": coral.500
- "MANAGED ROLE": red.500
- Description: description
- Name: name
- Stage: stage

tabs.2:
name: Project Inheritances
type: query-search-table
root_path: data.display.projectInheritances
fields:
- Name: data.display.inheritInfo.projectName
- Project ID: data.display.inheritInfo.projectId
- Roles: data.display.view
- Name: projectName
- Project ID: projectId
- Roles: view
type: more
popup_name: Roles
popup_key: data.display.inheritInfo.roles
popup_key: roles
popup_type: simple-table
popup_fields:
- Title: title
- Type: type
type: enum
enums:
- "ORGANIZATION ROLE": blue.500
- "ORGANIZATION ROLE": coral.500
- "PROJECT ROLE": gray.500
- "MANAGED ROLE": coral.500
- "MANAGED ROLE": red.500
- Description: description
- Name: name
- Stage: stage
Expand Down Expand Up @@ -175,7 +173,7 @@ tabs.4:
root_path: data.display.affectedProjects
fields:
- Name: displayName
- Project ID: project_id
- Project ID: projectId
- State: state
type: enum
enums:
Expand Down

0 comments on commit bff58b0

Please sign in to comment.