-
Notifications
You must be signed in to change notification settings - Fork 335
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
fix(kumactl) warn version unknown #2438
Conversation
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
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.
Does this PR update #2400?
kumaBuildVersion, _ = client.GetVersion(context.Background()) | ||
kumaBuildVersion, err = client.GetVersion(context.Background()) | ||
if err != nil { | ||
kumactlLog.Error(err, "Unable to retrieve server version") |
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.
If we log an error here, we immediately print the same error below, can we omit one of these?
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 we should remove this log altogether. It won't be visible at all. We don't use logging in kumactl to not disrupt stdout.
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
also sorted imports in some of the tests Signed-off-by: Bart Smykla <bartek@smykla.com>
Signed-off-by: Bart Smykla <bartek@smykla.com>
Codecov Report
@@ Coverage Diff @@
## master #2438 +/- ##
==========================================
+ Coverage 52.41% 52.59% +0.17%
==========================================
Files 875 878 +3
Lines 47833 47874 +41
==========================================
+ Hits 25072 25179 +107
+ Misses 20722 20643 -79
- Partials 2039 2052 +13
Continue to review full report at Codecov.
|
Yes it does. Will link. |
* fix(kumactl) Warn when server version cannot be retrieved Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) Warn when server version cannot be retrieved Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) Add mock client Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) make check Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * chore(*) address review comments Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) make check results Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) update config cp add tests Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) rename import kuma_test to default also sorted imports in some of the tests Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) fix config cp kumactl remove tests Signed-off-by: Bart Smykla <bartek@smykla.com> Co-authored-by: Bart Smykla <bartek@smykla.com> Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> (cherry picked from commit 755ccf8)
* fix(kumactl) Warn when server version cannot be retrieved Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) Warn when server version cannot be retrieved Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) Add mock client Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) make check Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * chore(*) address review comments Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) make check results Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) update config cp add tests Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) rename import kuma_test to default also sorted imports in some of the tests Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) fix config cp kumactl remove tests Signed-off-by: Bart Smykla <bartek@smykla.com> Co-authored-by: Bart Smykla <bartek@smykla.com> Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> (cherry picked from commit 755ccf8) Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
* fix(kumactl) Warn when server version cannot be retrieved Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) Warn when server version cannot be retrieved Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) Add mock client Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * fix(kumactl) make check Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> * chore(*) address review comments Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) make check results Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) update config cp add tests Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) rename import kuma_test to default also sorted imports in some of the tests Signed-off-by: Bart Smykla <bartek@smykla.com> * chore(*) fix config cp kumactl remove tests Signed-off-by: Bart Smykla <bartek@smykla.com> Co-authored-by: Bart Smykla <bartek@smykla.com> Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> (cherry picked from commit 755ccf8) Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com> Co-authored-by: parkanzky <42279121+parkanzky@users.noreply.github.com> Co-authored-by: Bart Smykla <bartek@smykla.com> Signed-off-by: Paul Parkanzky <paul.parkanzky@konghq.com>
This test failure is a result of the combination of #2419 and #2438. The fix is to test for error output using a substring match, which was already done in most places in #2438, but this instance was overlooked. Signed-off-by: James Peach <james.peach@konghq.com> (cherry picked from commit 10d4926) Co-authored-by: James Peach <james.peach@konghq.com>
Summary
Added warning in case where server version cannot be retrieved.
This required to update every kumactl test, since they all depended upon there being no kuma-cp on localhost and the resulting connection-refused from the server, on every command, being ignored.
So, added a mock client which always returns a given version, or defaults to current version if none is passed in.
Full changelog
Issues resolved
#2400
Documentation
Testing
Backwards compatibility
backport-to-stable
label if the code is backwards compatible. Otherwise, list breaking changes.