-
Notifications
You must be signed in to change notification settings - Fork 220
OCPBUGS-16089: Set spec.subdomain on the canary route #965
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
OCPBUGS-16089: Set spec.subdomain on the canary route #965
Conversation
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/jira refresh |
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
e2e-aws-ovn-serial failed because AWS is full: /test e2e-aws-ovn-serial e2e-azure-operator failed because the "eastus" region went missing: From Slack discussion, it seems like this sort of thing might be a "hiccup". |
3f326ea to
7315ba0
Compare
|
https://github.com/openshift/cluster-ingress-operator/compare/3f326ea54a6fba8cd5dc4e34925c9d573d23638b..7315ba0b63dfd9150e6294d681f5f936a5f02d5a fixes some places in the code that used |
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
7315ba0 to
8ac3ec1
Compare
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
https://github.com/openshift/cluster-ingress-operator/compare/7315ba0b63dfd9150e6294d681f5f936a5f02d5a..8ac3ec1e5504c69ed960973a8cd18ee7b53855cc fixes some E2E tests that used |
8ac3ec1 to
0546494
Compare
|
https://github.com/openshift/cluster-ingress-operator/compare/8ac3ec1e5504c69ed960973a8cd18ee7b53855cc..05464949e91c275a80f65c107d9649da0ad6c5f5 revises the previous fix for E2E tests to take into account that some E2E tests do not use the default IngressController. |
|
e2e-azure-operator failed because
e2e-gcp-operator failed because e2e-aws-operator failed because must-gather failed. |
Change Test_desiredCanaryRoute to check both the route's and the service's owner references, and print the correct error message if either the route or the service has an unexpected value. Before this change, Test_desiredCanaryRoute checked the route's owner references but erroneously referred to the service in the failure message if the route had an unexpected value. * pkg/operator/controller/canary/route_test.go (Test_desiredCanaryRoute): Fix checks for owner references.
* pkg/operator/controller/canary/route_test.go (Test_desiredCanaryRoute): Use assert.Equal and assert.True from the testify package.
0546494 to
649435d
Compare
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/hold cancel |
|
/assign @gcs278 |
gcs278
left a comment
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.
Mainly just question, but generally looks good to me.
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.
Should https://github.com/openshift/cluster-ingress-operator/pull/965/files#diff-aabcb3468eb7e3e07cce919ec78adc2f6012ed230991bc7f40f62868ada392d7R100 canaryRouteChanged now reconcile spec.subdomain?
I notice I can change the subdomain field and it won't get reconciled back.
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'm ambivalent about that since (a) we don't check spec.host, (b) leaving spec.host and spec.subdomain on their existing values on upgrade seems lowest risk, and (c) it isn't necessary to change canaryRouteChanged to fix the reported bug (which concerns the behavior when someone deletes the route). However, reconciling spec.host and spec.subdomain would be more consistent with the guiding principals for the platform. I can go ahead and make the 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.
| contentEncoding := header.Get("Content-Encoding") | ||
| if contentEncoding != expectedContentEncoding { | ||
| return false, fmt.Errorf("compression error: expected %q, got %q for %s route", expectedContentEncoding, contentEncoding, route.Name) | ||
| return false, fmt.Errorf("compression error: expected %q, got %q for %s route", expectedContentEncoding, contentEncoding, routeHost) |
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 fine, but curious if you meant to change route.Name to the hostname of the route?
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 was an intentional change; I needed routeHost elsewhere in the function, and it seemed simpler to use it in this log message rather than pass in both routeHost and route.
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.
Ack, sounds good to me.
| // function does not check the "Admitted" status condition, so it will return | ||
| // the host name if it is set even if the IngressController has rejected the | ||
| // route. | ||
| func getRouteHost(t *testing.T, route *routev1.Route, router string) string { |
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.
Would switching canary.getRouteHost to public be a better option than duplicating?
Or is this intentional because it's just E2E test code?
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 function is simple and yet specialized enough that it seemed simpler to me to duplicate a few lines rather than convert the other getRouteHost into a public interface.
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.
Ack.
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.
Any concerns with downgrading? I think route.spec.subdomain was introduced in 4.11, but I'm not sure.
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.
Right, spec.subdomain was implemented in 4.11. On downgrade from 4.14 to 4.13, the route could have spec.subdomain set and spec.host empty, and this would be fine because 4.13 doesn't reconcile either of those fields and both are implemented in 4.13.
Set spec.subdomain on the canary route so that the route is exposed using the respective domain of any shard that exposes the route. Before this commit, the canary route specified neither spec.subdomain nor spec.host, and so the API server would set a default value for spec.host using the cluster ingress domain. If the cluster ingress domain didn't match the default IngressController's domain, then this would cause canary checks to fail. For example, the cluster-admin could end up in this situation by first using the cluster ingress config's appsDomain option to set a custom domain different from the domain of the default IngressController and then deleting the canary route so that it would be recreated with the custom domain. This commit ensures that the canary route continues to work in this example. This commit fixes OCPBUGS-16089. https://issues.redhat.com/browse/OCPBUGS-16089 * pkg/operator/controller/canary/controller.go (startCanaryRoutePolling): * pkg/operator/controller/canary/http.go (probeRouteEndpoint): Use the new getRouteHost helper function. * pkg/operator/controller/canary/route.go (canaryRouteChanged): Check whether spec.host or spec.subdomain have changed, and update them if they have. (desiredCanaryService): Specify spec.subdomain. (getRouteHost): New function. Return the host name of the route for the default IngressController. * pkg/operator/controller/canary/route_test.go (Test_desiredCanaryRoute): Verify that the route has the expected value for spec.subdomain. (Test_canaryRouteChanged): Verify that canaryRouteChanged checks and updates the spec.host and spec.subdomain fields. (Test_getRouteHost): New test. Verify that getRouteHost behaves correctly. * test/e2e/canary_test.go (TestCanaryRoute): * test/e2e/client_tls_test.go (TestClientTLS, TestMTLSWithCRLs): * test/e2e/operator_test.go (TestHTTPHeaderCapture, TestHTTPCookieCapture): * test/e2e/router_compression_test.go (TestRouterCompressionOperation) (testCompressionPolicy, getHttpHeaders): Use the new getRouteHost test helper function. * test/e2e/util_test.go (getRouteHost): New test helper function. Return the host name of the route for the named IngressController.
649435d to
530d326
Compare
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@Miciah: This pull request references Jira Issue OCPBUGS-16089, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
https://github.com/openshift/cluster-ingress-operator/compare/649435d3a9157535243c51d5bbe4d6a6a15040bc..530d326013c9169d1efee77387f33c9ec13108d4 updates |
|
Thanks for the detailed responses. Looks good to me. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gcs278 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
e2e-hypershift failed because a bunch of tests failed: |
|
e2e-aws-operator failed because must-gather failed. e2e-azure-operator failed because the kube-apiserver operator was slow to roll out changes, with etcd logging "apply request took too long"; Vadim tells me this is "a classic case of slow Azure disks". |
|
@Miciah: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@Miciah: Jira Issue OCPBUGS-16089: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-16089 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Test_desiredCanaryRoute: Fix owner reference checkChange
Test_desiredCanaryRouteto check both the route's and the service's owner references, and print the correct error message if either the route or the service has an unexpected value.Before this change,
Test_desiredCanaryRoutechecked the route's owner references but erroneously referred to the service in the failure message if the route had an unexpected value.pkg/operator/controller/canary/route_test.go(Test_desiredCanaryRoute): Fix checks for owner references.Test_desiredCanaryRoute: Use testifypkg/operator/controller/canary/route_test.go(Test_desiredCanaryRoute): Useassert.Equalandassert.Truefrom the testify package.Set
spec.subdomainon the canary routeSet
spec.subdomainon the canary route so that the route is exposed using the respective domain of any shard that exposes the route.Before this change, the canary route specified neither
spec.subdomainnorspec.host, and so the API server would set a default value forspec.hostusing the cluster ingress domain. If the cluster ingress domain didn't match the default IngressController's domain, then this would cause canary checks to fail.For example, the cluster-admin could end up in this situation by first using the cluster ingress config's
appsDomainoption to set a custom domain different from the domain of the default IngressController and then deleting the canary route so that it would be recreated with the custom domain. This change ensures that the canary route continues to work in this example.pkg/operator/controller/canary/controller.go(startCanaryRoutePolling):pkg/operator/controller/canary/http.go(probeRouteEndpoint): Use the newgetRouteHosthelper function.pkg/operator/controller/canary/route.go(canaryRouteChanged): Check whetherspec.hostorspec.subdomainhave changed, and update them if they have.(
desiredCanaryService): Specifyspec.subdomain.(
getRouteHost): New function. Return the host name of the route for the default IngressController.pkg/operator/controller/canary/route_test.go(Test_desiredCanaryRoute): Verify that the route has the expected value forspec.subdomain.(
Test_canaryRouteChanged): Verify thatcanaryRouteChangedchecks and updates thespec.hostandspec.subdomainfields.(
Test_getRouteHost): New test. Verify thatgetRouteHostbehaves correctly.test/e2e/canary_test.go(TestCanaryRoute):test/e2e/client_tls_test.go(TestClientTLS,TestMTLSWithCRLs):test/e2e/operator_test.go(TestHTTPHeaderCapture,TestHTTPCookieCapture):test/e2e/router_compression_test.go(TestRouterCompressionOperation)(
testCompressionPolicy,getHttpHeaders): Use the newgetRouteHosttest helper function.test/e2e/util_test.go(getRouteHost): New test helper function. Return the host name of the route for the default IngressController./holdI'll need to rebase after #880 merges.