Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
cloud
Commits
b190da0d
Commit
b190da0d
authored
3 years ago
by
Masami Suzuki
Committed by
Yas Naoi
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3274216
by Masami, yas: Remove Cloud Project when K8s Cloud Service Provider is deleted
parent
2060ed40
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!1316
Issue #3310263: Release 4.5.0
,
!1260
Issue #3307397: Release 4.4.0
,
!837
Issue #3274216: Remove Cloud Project when K8s Cloud Service Provider is deleted
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cloud.module
+11
-0
11 additions, 0 deletions
cloud.module
with
11 additions
and
0 deletions
cloud.module
+
11
−
0
View file @
b190da0d
...
...
@@ -478,6 +478,17 @@ function cloud_mail($key, array &$message, array $params): void {
* Implements hook_cloud_config_predelete().
*/
function
cloud_cloud_config_predelete
(
CloudConfig
$cloud_config
):
void
{
// Delete all cloud project entities.
$storage
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
'cloud_project'
);
$entities
=
$storage
->
loadByProperties
([
'cloud_context'
=>
$cloud_config
->
getCloudContext
(),
'type'
=>
$cloud_config
->
bundle
(),
]);
if
(
!
empty
(
$entities
))
{
$storage
->
delete
(
$entities
);
}
// Delete cached operation data, if exists.
$cache_service
=
\Drupal
::
service
(
'cloud.cache'
);
$cache_service
->
clearOperationAccessCache
(
$cloud_config
->
getCloudContext
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment