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 1821095: Try to promote inactive routes following route deletion #126

Merged
merged 6 commits into from May 20, 2020

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented May 4, 2020

update deps

Try to promote inactive routes following route deletion

Before this patch, inactive routes were not being promoted when the conflicting routes were deleted. Fix it so that when deletes happen, all inactive routes are given a chance to be promoted.

Fix default template render output paths

Minor cleanup

Fix certificate and whitelist directory paths

Fix the paths for the certificate and CA certificate and whitelist directories. Commit c2f1bbd changed the router's working directory from /var/lib/haproxy/router to /var/lib/haproxy but did not update these directory paths, which are relative to the working directory path.

Follow-up to commit c2f1bbd.

  • images/router/haproxy/conf/haproxy-config.template:
  • images/router/nginx/conf/nginx-config.template: Add router/ to certificate directory paths.
  • pkg/router/template/router.go (certDir, caCertDir): Prepend router/.
    (whitelistDir): New constant with the path for whitelist files.
  • pkg/router/template/template_helper.go (generateHAProxyCertConfigMap): Use certDir.
    (generateHAProxyWhiteListFile): Use whitelistDir.
  • pkg/router/template/template_helper_test.go (TestGenerateHAProxyCertConfigMap, TestGenerateHAProxyMap): Adjust expected paths (relative to the working directory) for certificates.

writeDefaultCert: Log error writing default cert

If writing the default certificate out to disk fails, log the error message and use the certificate in the container image.

Before this commit, the router swallowed the error message and used the certificate in the container image on the assumptions that (1) the error could only result from the absence if a configured default certificate and (2) that the absence of a configured default certificate implied that the user did not intend to configure a default certificate. Logging the error makes it easier for the user to understand what is happening if one or both of these assumptions do not hold true.

  • pkg/router/template/router.go (writeDefaultCert): If writing the default certificate fails, log the error message. Improve the wording of the log message that indicates that the router is using the certificate from the container image.

This is #122 with some fix-ups.

@frobware, @danehans

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label May 4, 2020
@openshift-ci-robot
Copy link
Contributor

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

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1821095: Try to promote inactive routes following route deletion

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 bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 4, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2020
@Miciah Miciah force-pushed the delete-activation branch 2 times, most recently from 1861ea8 to 3a75917 Compare May 5, 2020 15:07
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Bugzilla bug 1821095, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1821095: Try to promote inactive routes following route deletion

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2020
ironcladlou and others added 6 commits May 8, 2020 12:09
Before this patch, inactive routes were not being promoted when the conflicting
routes were deleted. Fix it so that when deletes happen, all inactive routes are
given a chance to be promoted.
Fix the paths for the certificate and CA certificate and whitelist
directories.  Commit c2f1bbd changed the
router's working directory from /var/lib/haproxy/router to /var/lib/haproxy
but did not update these directory paths, which are relative to the working
directory path.

Follow-up to commit c2f1bbd.

* images/router/haproxy/conf/haproxy-config.template:
* images/router/nginx/conf/nginx-config.template: Add "router/" to
certificate directory paths.
* pkg/router/template/router.go (certDir, caCertDir): Prepend "router/".
(whitelistDir): New constant with the path for whitelist files.
* pkg/router/template/template_helper.go (generateHAProxyCertConfigMap):
Use certDir.
(generateHAProxyWhiteListFile): Use whitelistDir.
* pkg/router/template/template_helper_test.go
(TestGenerateHAProxyCertConfigMap, TestGenerateHAProxyMap): Adjust expected
paths (relative to the working directory) for certificates.
If writing the default certificate out to disk fails, log the error message
and use the certificate in the container image.

Before this commit, the router swallowed the error message and used the
certificate in the container image on the assumptions that (1) the error
could only result from the absence if a configured default certificate
and (2) that the absence of a configured default certificate implied that
the user did not intend to configure a default certificate.  Logging the
error makes it easier for the user to understand what is happening if one
or both of these assumptions do not hold true.

* pkg/router/template/router.go (writeDefaultCert): If writing the default
certificate fails, log the error message.  Improve the wording of the log
message that indicates that the router is using the certificate from the
container image.
@Miciah
Copy link
Contributor Author

Miciah commented May 8, 2020

Rebased.

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2020
@danehans
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 19, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danehans, 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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 869a3dc into openshift:master May 20, 2020
@openshift-ci-robot
Copy link
Contributor

@Miciah: Some pull requests linked via external trackers have merged: . The following pull requests linked via external trackers have not merged:

In response to this:

Bug 1821095: Try to promote inactive routes following route deletion

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
Copy link
Contributor Author

Miciah commented May 21, 2020

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@Miciah: Some pull requests linked via external trackers have merged: . The following pull requests linked via external trackers have not merged:

In response to this:

/bugzilla refresh

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
Copy link
Contributor Author

Miciah commented May 21, 2020

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@Miciah: All pull requests linked via external trackers have merged: openshift/router#126. Bugzilla bug 1821095 has been moved to the MODIFIED state.

In response to this:

/bugzilla refresh

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 added a commit to Miciah/origin that referenced this pull request May 27, 2020
Delete a reference to routes.json, which
openshift/router#126 deleted,
when dumping router pod info

* test/extended/router/router.go: Delete routes.json from cat command.
Miciah added a commit to Miciah/origin that referenced this pull request May 27, 2020
Delete a reference to routes.json, which
openshift/router#126 deleted,
when dumping router pod info.

* test/extended/router/router.go: Delete routes.json from cat command.
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/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants