-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop entity classes #292
Drop entity classes #292
Conversation
0755996
to
b7978d0
Compare
@cben @grosser @kirs @jimmidyson Please take a look |
@jhernand please take a look |
@moolitayer will this be backported to 2.x, or is it only for 3.x? |
README.md
Outdated
Checking the type of a resource can be done using: | ||
``` | ||
> pod.kind | ||
Pod |
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.
I think this is a string — quotes missing?
d317c2e
to
f3d9841
Compare
@@ -113,7 +113,7 @@ def delete_replication_controllers(client, namespace, replication_controllers) | |||
private | |||
|
|||
def construct_base_rc(namespace) | |||
rc = Kubeclient::ReplicationController.new | |||
rc = Kubeclient::Resource.new |
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.
Shouldn't one set rc.kind
now that it's not implied by class?
IIUC, it works because we use these objects via create_replication_controller
.
It's not ideal end state (though maybe fine for now) if some Resource objects around will have .kind
and some won't, and what works depends on how you use it...
cf #235, #241.
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.
It is correct though it did not change in this PR.
@@ -271,7 +252,7 @@ def watch_entities(resource_name, options = {}) | |||
# | |||
# Default response type will return a collection RecursiveOpenStruct | |||
# (:ros) objects, unless `:as` is passed with `:raw`. | |||
def get_entities(entity_type, klass, resource_name, options = {}) |
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.
Are get_entities
, get_entity
public APIs? 👍 on this change, but if yes it should be documented.
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.
They are not, we agreed to add a comment separately in the README.md saying any usage
not documented in the README.md is not supported.
f3d9841
to
bda0bf8
Compare
bda0bf8
to
52c0084
Compare
Fix #198
Drop entity classes (e.g Kubeclient::Service).
Using them required dynamically creating classes under Kubeclient namespace during discovery.
We have had several hairy bugs around this area, and the code does not have real benefit for users.
Part of: #199