This repository was archived by the owner on May 6, 2020. It is now read-only.
ref(scheduler): split up the scheduler code into individual resources and to be modular#1016
Merged
helgi merged 1 commit intodeis:masterfrom Aug 26, 2016
Merged
ref(scheduler): split up the scheduler code into individual resources and to be modular#1016helgi merged 1 commit intodeis:masterfrom
helgi merged 1 commit intodeis:masterfrom
Conversation
|
@kmala, @bacongobbler and @mboersma are potential reviewers of this pull request based on my analysis of |
Current coverage is 87.09% (diff: 77.18%)@@ master #1016 diff @@
==========================================
Files 29 41 +12
Lines 3289 3464 +175
Methods 0 0
Messages 0 0
Branches 557 578 +21
==========================================
+ Hits 2847 3017 +170
- Misses 291 292 +1
- Partials 151 155 +4
|
8db6143 to
02f9505
Compare
Contributor
Author
|
There was a successful e2e run but CI didn't update GH - https://ci.deis.io/job/workflow-test-pr/5904/console |
|
|
||
| @staticmethod | ||
| def unhealthy(status_code): | ||
| if not 200 <= status_code <= 299: |
Member
There was a problem hiding this comment.
This function could be simplified:
def unhealthy(status_code):
return 200 <= status_code <= 299
Contributor
Author
There was a problem hiding this comment.
Sure could, but it was just a copy of what we had there originally but brought into the class
Member
|
My comments are all minor and can be ignored. Nice refactor! :lgtm: |
… and to be modular This adds a resources package which contains all Kubernetes resources as their own individual classes. Each resource is self registering via the ResourceRegistry metaclass, this allows the base Resource class to know what resources are available and expose that up into KubeHTTPClient Each resource can specify their own api prefix and version, which allows us to support resources moving between API endpoints (see HPA, a new resource). To make it easy for resource to interact with one another each resource and the KubeHTTPClient can access other resources via `self.hpa.create()` or `self.pod.get()`, the short form (if a resource supports that) works, singular and plural also work via some intelligent mapping `version()` was added to let Resources find out what Kubernetes version they are dealing with. Closes deis#875
Contributor
Author
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds a resources package which contains all Kubernetes resources as their own individual classes.
Each resource is self registering via the ResourceRegistry metaclass, this allows the base Resource class to know what resources are available and expose that up into KubeHTTPClient
Each resource can specify their own api prefix and version, which allows us to support resources moving between API endpoints (see HPA, a new resource).
To make it easy for resource to interact with one another each resource and the KubeHTTPClient can access other resources via
self.hpa.create()orself.pod.get(), the short form (if a resource supports that) works, singular and plural also work via some intelligent mappingAdditionally
get()andgets()have been merged together into oneget()per Resourceversion()was added to let Resources find out what Kubernetes version they are dealing with.Closes #875