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

CFE-987: Use RouterExternalCertificate feature gate for adding ROUTER_ENABLE_EXTERNAL_CERTIFICATE env var to the router pods #1017

Conversation

arkadeepsen
Copy link
Contributor

@arkadeepsen arkadeepsen commented Jan 23, 2024

Use RouterExternalCertificate feature gate and add ROUTER_ENABLE_EXTERNAL_CERTIFICATE env var to the router pod based on the feature gate according to the EP openshift/enhancements#1307.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 23, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 23, 2024

@arkadeepsen: This pull request references CFE-987 which is a valid jira issue.

In response to this:

Use RouterExternalCertificate feature gate and add ROUTER_EXTERNAL_CERTIFICATE env var to the router pod based on the feature gate according to the EP openshift/enhancements#1307.

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 openshift-eng/jira-lifecycle-plugin repository.

@arkadeepsen
Copy link
Contributor Author

/retest

} else {
env = append(env,
corev1.EnvVar{Name: "ROUTER_EXTERNAL_CERTIFICATE", Value: "false"},
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to only add the env variable, if routeExternalCertificateEnabled. If feature-gate is not enabled, then do nothing. At the router side we will check ROUTER_EXTERNAL_CERTIFICATE exists or not, and take actions accordingly.

In that case, we can skip the else statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@candita
Copy link
Contributor

candita commented Jan 24, 2024

/assign @alebedev87

@arkadeepsen
Copy link
Contributor Author

/retest

Copy link
Contributor

@alebedev87 alebedev87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of remarks which can be easily addressed and I'm good to LGTM.

// Add router external certificate environment variable.
if routeExternalCertificateEnabled {
env = append(env,
corev1.EnvVar{Name: "ROUTER_EXTERNAL_CERTIFICATE", Value: "true"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming in ROUTER_EXTERNAL_CERTIFICATE doesn't seem to reflect the meaning passed to the router. It looks like we try to pass the name or some sort of reference to an external certificate. While what we do is we try to enable the handling of the external certificate field.

Suggested change
corev1.EnvVar{Name: "ROUTER_EXTERNAL_CERTIFICATE", Value: "true"},
corev1.EnvVar{Name: "ROUTER_EXTERNAL_CERTIFICATE_ENABLED", Value: "true"},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was mentioned in the EP here which I am following. I guess we'd need to change the EP as well if we make this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's hard to focus on the right name in the future code during the EP review. I think it's fine to tweak it in the EP if we find a better name down the implementation line.
I looked at the other variables from the router deployment and found ROUTER_ENABLE_COMPRESSION or ROUTER_DISABLE_HTTP2. I think we should follow the same pattern:

Suggested change
corev1.EnvVar{Name: "ROUTER_EXTERNAL_CERTIFICATE", Value: "true"},
corev1.EnvVar{Name: "ROUTER_ENABLE_EXTERNAL_CERTIFICATE", Value: "true"},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. @chiragkyal can you please take a note of this change in the EP? This would also need updating the Router implementation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads-up. Noted in https://issues.redhat.com/browse/CFE-1038

pkg/operator/controller/ingress/deployment_test.go Outdated Show resolved Hide resolved
pkg/operator/controller/ingress/deployment_test.go Outdated Show resolved Hide resolved
…RNAL_CERTIFICATE env var to the router pod based on the feature gate.
@arkadeepsen arkadeepsen force-pushed the router-external-certificate-feature-gate branch from fd22bec to 4b56133 Compare February 26, 2024 12:40
@arkadeepsen
Copy link
Contributor Author

/retest

1 similar comment
@arkadeepsen
Copy link
Contributor Author

/retest

Copy link
Contributor

openshift-ci bot commented Feb 26, 2024

@arkadeepsen: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-single-node 4b56133 link false /test e2e-aws-ovn-single-node

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@alebedev87
Copy link
Contributor

@arkadeepsen : can you please update the title and the description of the PR according to the latest changes?

@alebedev87
Copy link
Contributor

/lgtm
/approve

@arkadeepsen arkadeepsen changed the title CFE-987: Use RouterExternalCertificate feature gate for adding ROUTER_EXTERNAL_CERTIFICATE env var to the router pods CFE-987: Use RouterExternalCertificate feature gate for adding ROUTER_ENABLE_EXTERNAL_CERTIFICATE env var to the router pods Feb 27, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Feb 27, 2024

@arkadeepsen: This pull request references CFE-987 which is a valid jira issue.

In response to this:

Use RouterExternalCertificate feature gate and add ROUTER_ENABLE_EXTERNAL_CERTIFICATE env var to the router pod based on the feature gate according to the EP openshift/enhancements#1307.

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 openshift-eng/jira-lifecycle-plugin repository.

@arkadeepsen
Copy link
Contributor Author

@arkadeepsen : can you please update the title and the description of the PR according to the latest changes?

Done

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2024
Copy link
Contributor

openshift-ci bot commented Feb 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit a96d79f into openshift:master Feb 27, 2024
13 of 14 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-cluster-ingress-operator-container-v4.16.0-202402271510.p0.ga96d79f.assembly.stream.el9 for distgit ose-cluster-ingress-operator.
All builds following this will include this PR.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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