-
Notifications
You must be signed in to change notification settings - Fork 77
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
Adds rewrite-target annotation, tests for Nginx Annotations… #637
Conversation
pkg/server/k8s/client_test.go
Outdated
@@ -374,7 +374,31 @@ func TestHasAnotherIngress(t *testing.T) { | |||
t.Fatal("got unexpected error:", err) | |||
} | |||
|
|||
if rs != false { | |||
if rs != true { | |||
t.Errorf("got true; want false") |
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.
Could you explain this change?
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.
The original test was wrong 😅 . We create another ingress, so HasAnotherIngress should've returned true.
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 returned false because the k8s state wasn't persisted between function calls.
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.
Hm... Maybe we could remove the test or change error messgage
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.
☝️
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.
@drgarcia1986 I'll change the error message and the variable names, so it'll become less confusing.
…pts to singleton kubernetes fake client
Codecov Report
@@ Coverage Diff @@
## master #637 +/- ##
==========================================
- Coverage 50.48% 50.25% -0.23%
==========================================
Files 86 86
Lines 6224 6230 +6
==========================================
- Hits 3142 3131 -11
- Misses 2867 2887 +20
+ Partials 215 212 -3
Continue to review full report at Codecov.
|
This PR adds the
nginx.ingress.kubernetes.io/rewrite-target: /
when ingress class is nginx, adds tests for Nginx Annotations and attempts to create a singleton for building a kubernetes fake client.Fixes #636