feat: optional cascade delete resources when deleting workspace
Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
@@ -44,3 +44,14 @@ func RemoveWorkspaceOwnerReference(ownerReferences []metav1.OwnerReference) []me
|
||||
}
|
||||
return tmp
|
||||
}
|
||||
|
||||
// GetWorkspaceOwnerName return workspace kind owner name
|
||||
func GetWorkspaceOwnerName(ownerReferences []metav1.OwnerReference) string {
|
||||
for _, owner := range ownerReferences {
|
||||
if owner.Kind == tenantv1alpha1.ResourceKindWorkspace ||
|
||||
owner.Kind == tenantv1alpha2.ResourceKindWorkspaceTemplate {
|
||||
return owner.Name
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user