-
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
move exception into Kubeclient namespace #195
Conversation
e1841fd
to
f9787c4
Compare
IIUC this is not backward-compatible. We may have to properly schedule this because we just released a major version. @moolitayer can you review? |
... made it backwards compatible by defining the constant ... |
4ed385a
to
e8481bd
Compare
Generally agree. Should not merge until we mean to version bump. |
This would need a line in Readme in the Upgrading section |
it is backwards compatible now ... so can merge ? ... also added a line to the upgrading section |
This does not appear to be backward compatible, you are changing tests code to handle the new exception class. Please squash the change and have it ready to merge once we agree on a bump. I will create an issue to track all of our non backward compatible changes |
af07786
to
115c309
Compare
It is backwards compatible because the old constant still exists.
|
115c309
to
f63d511
Compare
build has same errors as on master ... added a minor cleanup to avoid defining a global method |
@moolitayer ok to merge ? |
@moolitayer ok to merge or what do you want changed ? |
|
||
def config_file(name) | ||
File.new(File.join(File.dirname(__FILE__), 'config', name)) | ||
end |
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.
what is this change for (test_config_file => config_file)?
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.
please add a test for the backward compatibility you are maintaining. Then I'm good with this change. @simon3z please review, are we going to merge anything before the integration problem is fixed or should that be fixed first?
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.
things that start with test_
are tests, so I found this confusing/dangerous ... so changing to config_file
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.
... and it was a global method ... moving it inside the test where it belongs caused it to run as test
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.
👍 for this change, but things usually have a better change of being review if they are as restricted as possible...
f63d511
to
5092d3e
Compare
test added! |
LGTM @simon3z please review |
lib/kubeclient/http_exception.rb
Outdated
@@ -0,0 +1,20 @@ | |||
# TODO: remove this on next major version bump | |||
class KubeException < StandardError |
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.
@grosser don't you need the body here? (initialize
, etc.)
Technically I suppose it works because you throw a Kubeclient::HttpException
which contains the relevant attributes. Although to be strict, just by how this is defined, there could be KubeException
with no :error_code
, :message
, :response
, which is not backward compatible.
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.
Fixed
fa5ad97
to
1b54fc2
Compare
ready! |
error_message = 'certificate verify failed' | ||
|
||
stub_request(:get, 'http://localhost:8080/api') | ||
.to_raise(OpenSSL::SSL::SSLError.new(error_message)) |
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.
So this exception is caught by rest-client and translated to a rest client error(since we only catch those afaik)?
Can you make it more straight forward (like the test above?)
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.
see above please
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 added this test to say "if an ssl error happens, kubeclient should react this way" ... I it wanted it to not matter what plumbing layer is in-between.
@simon3z is this direction desired? (I think this is generally good for us) |
@grosser could you fix the conflicts? |
2985bdc
to
96f9a82
Compare
updated |
96f9a82
to
87b8ff1
Compare
@cben con you review the (minor) change/rebase and re-approve? I think we can merge this. |
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.
thanks!
🎉 |
@moolitayer @grosser This is safe for next 2.x release we're assembling, but we need to fix README note (on master too) to use correct class name and speak of 3.0 not 2.0 (?) |
so you are planing to remove KubeException in v3 ? |
move exception into Kubeclient namespace # Conflicts: # README.md # lib/kubeclient/common.rb
Reverts parts of commit 263ff40 from ManageIQ#271 that restored KubeException - no longer needed after backporting ManageIQ#195 and ManageIQ#233, we now have Kubeclient::HttpError and Kubeclient::ResourceNotFoundError. In other words, v2.x branch is now closer to original ManageIQ#262.
Reverts parts of commit 263ff40 from ManageIQ#271 that restored KubeException - no longer needed after backporting ManageIQ#195 and ManageIQ#233, we now have Kubeclient::HttpError and Kubeclient::ResourceNotFoundError. In other words, v2.x branch is now closer to original ManageIQ#262.
This reverts commit 263ff40 from ManageIQ#271. Those backport changes are no longer needed: - after backporting ManageIQ#195 and ManageIQ#233, v2.x now has Kubeclient::HttpError and Kubeclient::ResourceNotFoundError. - after backporting ManageIQ#247, v2.x now tests with webmock 2.x, it takes `basic_auth` rather than user:pw in URL. - ns/namespace change was just cosmetic. In other words, v2.x branch is now closer to original ManageIQ#262.
move exception into Kubeclient namespace # Conflicts: # README.md # lib/kubeclient/common.rb
This reverts commit 263ff40 from ManageIQ#271. Those backport changes are no longer needed: - after backporting ManageIQ#195 and ManageIQ#233, v2.x now has Kubeclient::HttpError and Kubeclient::ResourceNotFoundError. - after backporting ManageIQ#247, v2.x now tests with webmock 2.x, it takes `basic_auth` rather than user:pw in URL. - ns/namespace change was just cosmetic. In other words, v2.x branch is now closer to original ManageIQ#262.
@abonas @simon3z
seems weird that it got defined in the top-level namespace ...