-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Service cap-add/cap-drop: handle updates as "tri-state"
Adding/removing capabilities when updating a service is considered a tri-state; - if the capability was previously "dropped", then remove it from "CapabilityDrop", but do NOT add it to "CapabilityAdd". However, if the capability was not yet in the service's "CapabilityDrop", then simply add it to the service's "CapabilityAdd" - likewise, if the capability was previously "added", then remove it from "CapabilityAdd", but do NOT add it to "CapabilityDrop". If the capability was not yet in the service's "CapabilityAdd", then simply add it to the service's "CapabilityDrop". In other words, given a service with the following: | CapDrop | CapAdd | | -------------- | ------------- | | CAP_SOME_CAP | | When updating the service, and applying `--cap-add CAP_SOME_CAP`, the previously dropped capability is removed: | CapDrop | CapAdd | | -------------- | ------------- | | | | When updating the service a second time, applying `--cap-add CAP_SOME_CAP`, capability is now added: | CapDrop | CapAdd | | -------------- | ------------- | | | CAP_SOME_CAP | Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
2 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters