Closed linkdd closed 6 months ago
current status: ✅
Overall Coverage
Lines Covered Coverage Threshold Status 2152 2118 98% 90% ✅ New Files
No new covered files...
Modified Files
No covered modified files...
updated for commit:
235665c
by action🐍
created | restarting | running | paused | exited | dead | none | |
---|---|---|---|---|---|---|---|
Create | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Start | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |
Stop | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
Restart | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
Recreate | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ |
Delete | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
I see an improvement for the next PR : if container operation == "none" then no operation allowed on container
Decision Record
Closes #119. Closes https://github.com/SaaShup/netbox-docker-agent/issues/55
Actions on a container should not be possible based on its state:
(edited by @lvenier)
NB: If the state is
none
(therefore, the agent failed to communicate the container's real state), then we prevent any action until it is resolved, as we cannot guarantee anything, except when:operation=create
andstate=none
, which must be validoperation=none
, which must always be validIt does not seem possible to add a
disabled
state to the delete/bulk-delete buttons in Netbox. Therefore, thepre_delete
model signal should be intercepted to apply the constraint there.Changes
disabled
state on container's extra control buttonsrunning
/restarting
state
andoperation
do not pass restrictions check