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

Simplify generateCertConfigMapEntry #137

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Jun 5, 2020

Delete superfluous conditions in the cert_config.map generation logic.

#125 modified the logic that generates entries in cert_config.map in order to add [alpn h2,http/1.1] stanzas, with the condition that the stanza was only added if the backend the corresponded to an entry had a certificate and specified edge or reencrypt termination. However, the generation logic already only adds entries for backends that have certificates and specify either edge or reencrypt termination, so the additional condition is superfluous.

  • pkg/router/template/template_helper.go (generateHAProxyCertConfigMap): Replace use of SSLBindConfig with a string literal.
  • pkg/router/template/util/haproxy/map_entry.go (generateCertConfigMapEntry):
  • pkg/router/template/util/haproxy/map_entry_test.go (TestGenerateCertConfigMapEntry): Delete initialization of SSLBindConfig.
  • pkg/router/template/util/haproxy/types.go (HAProxyMapEntry): Delete SSLBindConfig.

@frobware, this PR reverts some of the changes you made in #125. If you look at generateCertConfigMapEntry in its entirety, you can see that the logic is redundant. Sorry I missed this during review!

Delete superfluous conditions in the cert_config.map generation logic.

Commit bf8bdff modified the logic that
generates entries in cert_config.map in order to add "[alpn h2,http/1.1]"
stanzas, with the condition that the stanza was only added if the backend
the corresponded to an entry had a certificate and specified edge or
reencrypt termination.  However, the generation logic already only adds
entries for backends that have certificates and specify either edge or
reencrypt termination, so the additional condition is superfluous.

* pkg/router/template/template_helper.go (generateHAProxyCertConfigMap):
Replace use of SSLBindConfig with a string literal.
* pkg/router/template/util/haproxy/map_entry.go
(generateCertConfigMapEntry):
* pkg/router/template/util/haproxy/map_entry_test.go
(TestGenerateCertConfigMapEntry): Delete initialization of SSLBindConfig.
* pkg/router/template/util/haproxy/types.go (HAProxyMapEntry): Delete
SSLBindConfig.
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2020
@frobware
Copy link
Contributor

frobware commented Jun 9, 2020

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware, 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 7429950 into openshift:master Jun 9, 2020
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. 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

4 participants