Skip to content

Commit

Permalink
require root for calicoctl container remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Spike Curtis committed Apr 10, 2015
1 parent dd9cbf0 commit c8babce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions calicoctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ def container_remove(container_name):
:param container_name: The name or ID of the container.
"""
# The netns manipulations must be done as root.
if os.geteuid() != 0:
print >> sys.stderr, "`calicoctl container remove` must be run as " \
"root."
sys.exit(2)

# Resolve the name to ID.
container_id = get_container_id(container_name)

Expand Down

0 comments on commit c8babce

Please sign in to comment.