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

Update the updateServerConfig function to pass in the cert value diectly #3337

Conversation

Leo6Leo
Copy link
Contributor

@Leo6Leo Leo6Leo commented Sep 13, 2023

Fixes #3336

Proposed Changes

Now:

PemKeyCertOptions keyCertOptions = new PemKeyCertOptions()
            .setCertValue(Buffer.buffer(java.nio.file.Files.readString(tlsCrtFile.toPath())))
            .setKeyValue(Buffer.buffer(java.nio.file.Files.readString(tlsKeyFile.toPath())));

Past:

PemKeyCertOptions keyCertOptions =
                        new PemKeyCertOptions().setKeyPath(tlsKeyFile.getPath()).setCertPath(tlsCrtFile.getPath());

Release Note


Docs

@knative-prow
Copy link

knative-prow bot commented Sep 13, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2023
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/data-plane labels Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #3337 (e7b6346) into main (7e86a37) will increase coverage by 3.14%.
Report is 6 commits behind head on main.
The diff coverage is 72.72%.

❗ Current head e7b6346 differs from pull request most recent head ea4028e. Consider uploading reports for the commit ea4028e to get more accurate results

@@             Coverage Diff              @@
##               main    #3337      +/-   ##
============================================
+ Coverage     58.49%   61.63%   +3.14%     
- Complexity        0      768     +768     
============================================
  Files            91      182      +91     
  Lines          9233    12333    +3100     
  Branches          0      268     +268     
============================================
+ Hits           5401     7602    +2201     
- Misses         3403     4135     +732     
- Partials        429      596     +167     
Flag Coverage Δ
java-unittests 70.90% <72.72%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...g/kafka/broker/receiver/impl/ReceiverVerticle.java 78.78% <72.72%> (ø)

... and 92 files with indirect coverage changes

@Leo6Leo Leo6Leo marked this pull request as ready for review September 13, 2023 22:37
@Leo6Leo Leo6Leo changed the title [WIP] Update the updateServerConfig function to pass in the cert value diectly Update the updateServerConfig function to pass in the cert value diectly Sep 13, 2023
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2023
});
try {
// Update SSL configuration by passing the new value of the certificate and key
// Have to use value instead of path here otherwise the changes won't be applied
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious, do you know why this is the case @Leo6Leo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure whether problem is here or not.
https://github.com/eclipse-vertx/vert.x/blob/6954961d9b723ed245f91b6dedb41b9b09e991bd/src/main/java/io/vertx/core/net/impl/SSLHelper.java#L182C11-L182C71

Because the line if (prev.succeeded() && prev.result().options.equals(options)) { is checking whether the options are the same. If we are using the path, obviously the options doesn't get changed because the file path is the same. And so it doesn't get updated?

That's my guess. Wdyt @Cali0707 @pierDipi

Copy link
Member

Choose a reason for hiding this comment

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

That seems accurate, can you report that to the Vertx team https://github.com/eclipse-vertx/vert.x/issues/new/choose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

Nice findings @Leo6Leo

/lgtm
/approve

Left one nit comment to be consistent with the style of the other code which often use "final var"

});
try {
// Update SSL configuration by passing the new value of the certificate and key
// Have to use value instead of path here otherwise the changes won't be applied
Copy link
Member

Choose a reason for hiding this comment

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

That seems accurate, can you report that to the Vertx team https://github.com/eclipse-vertx/vert.x/issues/new/choose?

@knative-prow knative-prow bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 20, 2023
@pierDipi
Copy link
Member

/retest-required

…roker/receiver/impl/ReceiverVerticle.java

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2023
@Leo6Leo
Copy link
Contributor Author

Leo6Leo commented Sep 20, 2023

/retest-required

@knative-prow
Copy link

knative-prow bot commented Sep 20, 2023

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

Test name Commit Details Required Rerun command
reconciler-tests-keda_eventing-kafka-broker_main ea4028e link false /test reconciler-tests-keda
reconciler-tests-loom_eventing-kafka-broker_main ea4028e link false /test reconciler-tests-loom
reconciler-tests-namespaced-broker-loom_eventing-kafka-broker_main ea4028e link false /test reconciler-tests-namespaced-broker-loom

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.

@Leo6Leo
Copy link
Contributor Author

Leo6Leo commented Sep 21, 2023

/retest-required
/cc @Cali0707

@knative-prow knative-prow bot requested a review from Cali0707 September 21, 2023 19:35
Copy link
Member

@Cali0707 Cali0707 left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2023
@knative-prow
Copy link

knative-prow bot commented Sep 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, Leo6Leo, pierDipi

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

@knative-prow knative-prow bot merged commit 0502268 into knative-extensions:main Sep 21, 2023
@Leo6Leo
Copy link
Contributor Author

Leo6Leo commented Sep 22, 2023

/cherry-pick release-1.11

@knative-prow-robot
Copy link
Contributor

@Leo6Leo: new pull request created: #3358

In response to this:

/cherry-pick release-1.11

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. area/data-plane lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyPairRotation update doesn't work with secretVolumePath
4 participants