Skip to content
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

Bug 1780794: unique_host: HandleRoute: No error if host claimed #69

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Dec 7, 2019

Change the unique_host plugin's HandleRoute method not to return an error because the host name is claimed.

Returning an error causes the controller to log an unhelpful error message:

router_controller.go:244] another route has claimed this host

The plugin already logs the conflict, along with the host name and the claimants' names and namespaces, at a higher log level and updates the Route's status to indicate that it has been rejected because of a preëmpting claim. Moreover, a conflicting claim does not logically represent an error condition for the plugin or controller, and in the absence of such, it makes more sense return a nil error value after logging the condition.

  • pkg/router/controller/unique_host.go: Do not return a gratuitous error value for a preëmpting claim.
  • pkg/router/template/plugin_test.go (TestHandleRoute): Expect a nil error value from the unique_host plugin when handling a valid Route for which a preëmpting claim exists.

Change the unique_host plugin's HandleRoute method not to return an error
because the host name is claimed.

Returning an error causes the controller to log an unhelpful error message:

    router_controller.go:244] another route has claimed this host

The plugin already logs the conflict, along with the host name and the
claimants' names and namespaces, at a higher log level and updates the
Route's status to indicate that it has been rejected because of a
preëmpting claim.  Moreover, a conflicting claim does not logically
represent an error condition for the plugin or controller, and in the
absence of such, it makes more sense return a nil error value after logging
the condition.

This commit fixes bug 1780794.

https://bugzilla.redhat.com/show_bug.cgi?id=1780794

* pkg/router/controller/unique_host.go: Do not return a gratuitous error
value for a preëmpting claim.
* pkg/router/template/plugin_test.go (TestHandleRoute): Expect a nil error
value from the unique_host plugin when handling a valid Route for which a
preëmpting claim exists.
@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Dec 7, 2019
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Bugzilla bug 1780794, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1780794: unique_host: HandleRoute: No error if host claimed

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.

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 7, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2019
@ironcladlou
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 9, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, Miciah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit e5718cc into openshift:master Dec 9, 2019
@openshift-ci-robot
Copy link
Contributor

@Miciah: All pull requests linked via external trackers have merged. Bugzilla bug 1780794 has been moved to the MODIFIED state.

In response to this:

Bug 1780794: unique_host: HandleRoute: No error if host claimed

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants