summaryrefslogtreecommitdiff
path: root/app/services/clusters/cleanup/project_namespace_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/clusters/cleanup/project_namespace_service.rb')
-rw-r--r--app/services/clusters/cleanup/project_namespace_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/clusters/cleanup/project_namespace_service.rb b/app/services/clusters/cleanup/project_namespace_service.rb
index 16254041306..0173f93f625 100644
--- a/app/services/clusters/cleanup/project_namespace_service.rb
+++ b/app/services/clusters/cleanup/project_namespace_service.rb
@@ -35,9 +35,11 @@ module Clusters
end
def kubeclient_delete_namespace(kubernetes_namespace)
- cluster.kubeclient.delete_namespace(kubernetes_namespace.namespace)
+ cluster.kubeclient&.delete_namespace(kubernetes_namespace.namespace)
rescue Kubeclient::ResourceNotFoundError
- # no-op: nothing to delete
+ # The resources have already been deleted, possibly on a previous attempt that timed out
+ rescue Gitlab::UrlBlocker::BlockedUrlError
+ # User gave an invalid cluster from the start, or deleted the endpoint before this job ran
end
end
end