Revert builder.Unreachable() and add reachable check to builder.Build()#2109
Conversation
This reverts commit 576401b.
|
/assign @2uasimojo |
|
Need to add to kubeconfigBuilder as well |
2uasimojo
left a comment
There was a problem hiding this comment.
This looks great. Just one thing: can you add a comment above the new checks explaining what they're doing? So future-we don't have to rely on git blame.
With the controller-runtime upgrade from 8cfdcca, our remote client `Builder` interface's `Build()` method got lazier. Before, if the remote client was unreachable, `Build()` itself would fail. Now it won't fail until the resulting client is actually used. This resulted in our "unreachable" controller incorrectly marking the ClusterDeployment's APIURLOverride as reachable when it wasn't, which had the ripple effect of making the clustersync controller fail early by trying to use that URL rather than falling back to the default. This was exposed in situations where the DNS for the APIURLOverride was being configured via a syncset: the clustersync controller tried to use a URL that wouldn't resolve, so it couldn't sync the resource that would make that DNS work. To fix, this commit adds a check in the `Build()` method of the `Builder` interface. This internally builds the client and then uses it to query the `/apis` of the remote client. HIVE-2300 Signed-off-by: Leah Leshchinsky <lleshchi@redhat.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2109 +/- ##
=======================================
Coverage 57.54% 57.55%
=======================================
Files 187 187
Lines 25826 25810 -16
=======================================
- Hits 14862 14854 -8
+ Misses 9720 9711 -9
- Partials 1244 1245 +1
|
|
/test e2e-azure Ignore me, drive by. /test coverage infra flake |
|
@lleshchi: The following test failed, say
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. |
|
Totally different flake in e2e-azure. I won't continue to hold up this PR :) /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 2uasimojo, lleshchi 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 |
With the controller-runtime upgrade from 8cfdcca, our remote client
Builderinterface'sBuild()method got lazier. Before, if the remoteclient was unreachable,
Build()itself would fail. Now it won't failuntil the resulting client is actually used. This resulted in our
"unreachable" controller incorrectly marking the ClusterDeployment's
APIURLOverride as reachable when it wasn't, which had the ripple effect
of making the clustersync controller fail early by trying to use that
URL rather than falling back to the default.
This was exposed in situations where the DNS for the APIURLOverride was
being configured via a syncset: the clustersync controller tried to use
a URL that wouldn't resolve, so it couldn't sync the resource that would
make that DNS work.
Initially, to fix this issue, a
Reachable()method was added to theBuilder,but on further inspection, there are many cases where uses of the
Build()method result in a client being falsely marked as reachable.
To fix, this PR reverts the
Reachable()commit 576401band moves the reachability check to the
Build()method of theBuilderinterface.This internally builds the client and then uses it to query the
/apisof the remote client.xref: HIVE-2300