This repository has been archived by the owner on Feb 2, 2018. It is now read-only.
Kubernetes container handler #68
Merged
mbarnes
merged 22 commits into
projectatomic:master
from
ashcrow:kubernetes-container-handler
Dec 8, 2016
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b4cbcd8
containermgr: Added _fix_path to kubernetes handler.
ashcrow 7c06d35
containermgr: Added _put to kubernetes handler.
ashcrow 299fecb
containermgr: Added ContainerManagerError base exception class.
ashcrow f553aad
containermgr: Added register_node to kubernetes handler.
ashcrow 5d04eb3
containermgr: Added remove_node to kubernetes handler.
ashcrow e39b29a
containermgr: Added get_node_status to kubernetes handler.
ashcrow 2e83bba
doc: api docs for containermgr/service.
ashcrow 60b1011
fixup! containermgr: Added _fix_path to kubernetes handler.
ashcrow 7a3a5e8
fixup! containermgr: Added _put to kubernetes handler.
ashcrow dae9aff
fixup! containermgr: Added register_node to kubernetes handler.
ashcrow f59001c
fixup! containermgr: Added register_node to kubernetes handler.
ashcrow 6d20245
fixup! containermgr: Added ContainerManagerError base exception class.
ashcrow 24b5ac1
fixup! containermgr: Added remove_node to kubernetes handler.
ashcrow 96b564c
fixup! containermgr: Added get_node_status to kubernetes handler.
ashcrow 131864a
containermgr: Updated node_registered to work like other methods.
ashcrow 2b7ca59
test: Fix tests for the kubernetes containermgr.
ashcrow 83e3a74
fixup! containermgr: Updated node_registered to work like other methods.
ashcrow 866776f
vagrant: Auto starting commissaire-containermgr
ashcrow 0b4aa3d
fixup! containermgr: Added register_node to kubernetes handler.
ashcrow 0baf7fc
fixup! containermgr: Added remove_node to kubernetes handler.
ashcrow e8abc82
fixup! containermgr: Added get_node_status to kubernetes handler.
ashcrow 7554b75
fixup! containermgr: Updated node_registered to work like other methods.
ashcrow File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,22 @@ def check_config(cls, config): | |
'Server URL scheme must be "https" when using client ' | ||
'side certificates (got "{}")'.format(url.scheme)) | ||
|
||
def _fix_part(self, part): | ||
""" | ||
Fixes part if it doesn't start with a slash. | ||
|
||
:param part: The URI part. EG: /nodes | ||
:type part: str | ||
:returns: The part in the proper format. | ||
:rtype: str | ||
""" | ||
if not part.startswith('/'): | ||
self.logger.debug( | ||
'Part given without starting slash. Adding...') | ||
part = '/{}'.format(part) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This could just be |
||
|
||
return part | ||
|
||
def _get(self, part, *args, **kwargs): | ||
""" | ||
Get information from the Kubernetes apiserver. | ||
|
@@ -105,12 +121,7 @@ def _get(self, part, *args, **kwargs): | |
:type kwargs: dict | ||
:returns: requests.Response | ||
""" | ||
# Fix part if it doesn't start with a slash | ||
if not part.startswith('/'): | ||
self.logger.debug( | ||
'Part given without starting slash. Adding...') | ||
part = '/{}'.format(part) | ||
|
||
part = self._fix_part(part) | ||
self.logger.debug('Executing GET for {}'.format(part)) | ||
resp = self.con.get( | ||
'{}{}'.format(self.base_uri, part), *args, **kwargs) | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearer wording:
Ensures the URI part starts with a slash.