Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
996d8a38
Commit
996d8a38
authored
Sep 26, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: do NOT markFree the SHARED_REMOTE partition
parent
5cf38068
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToUnallocatePartition.py
...slapos_cloud/SoftwareInstance_tryToUnallocatePartition.py
+7
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
...eItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
+18
-0
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToUnallocatePartition.py
View file @
996d8a38
...
...
@@ -14,6 +14,13 @@ if partition is not None:
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
==
0
):
# No concurrency issue
instance
.
unallocatePartition
()
if
(
partition
.
getId
()
==
'SHARED_REMOTE'
)
and
(
partition
.
getParentValue
().
getPortalType
()
==
'Remote Node'
):
# Do not free the SHARED_REMOTE partition on Remote Node
# used to allocate Slave Instance
# This partition is always busy, as no Software Instance is allocated on it
return
instance_sql_list
=
portal
.
portal_catalog
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
],
aggregate__uid
=
partition
.
getUid
(),
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
View file @
996d8a38
...
...
@@ -333,6 +333,24 @@ class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin):
self
.
assertEqual
(
partition
.
getRelativeUrl
(),
software_instance
.
getAggregate
())
self
.
assertEqual
(
'busy'
,
partition
.
getSlapState
())
def
test_SoftwareInstance_tryToUnallocatePartition_script_sharedAndAllocatedOnRemoteNode
(
self
):
instance_tree
=
self
.
addInstanceTree
(
shared
=
True
)
software_instance
=
instance_tree
.
getSuccessorValue
()
remote_node
,
_
=
self
.
addComputeNodeAndPartition
(
portal_type
=
'Remote Node'
,
project
=
instance_tree
.
getFollowUpValue
())
partition
=
remote_node
.
restrictedTraverse
(
'SHARED_REMOTE'
)
software_instance
.
setAggregateValue
(
partition
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'destroy_requested'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'invalidated'
)
self
.
tic
()
software_instance
.
SoftwareInstance_tryToUnallocatePartition
()
self
.
assertEqual
(
None
,
software_instance
.
getAggregate
())
self
.
assertEqual
(
'busy'
,
partition
.
getSlapState
())
class
TestSlapOSGarbageCollectDestroyedRootTreeAlarm
(
SlapOSTestCaseMixin
):
#################################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment