kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.82k stars 1.41k forks source link

fixed the mTLS bug https://github.com/kubernetes-sigs/aws-load-balanc… #3717

Closed shethyogita83 closed 1 month ago

shethyogita83 commented 1 month ago

Fixing mTLS bug : https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/3715

Issue

Description

Checklist

BONUS POINTS checklist: complete for good vibes and maybe prizes?! :exploding_head:

linux-foundation-easycla[bot] commented 1 month ago

CLA Signed

The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shethyogita83 Once this PR has been reviewed and has the lgtm label, please assign johngmyers for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
k8s-ci-robot commented 1 month ago

Welcome @shethyogita83!

It looks like this is your first PR to kubernetes-sigs/aws-load-balancer-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-load-balancer-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 1 month ago

Hi @shethyogita83. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
oliviassss commented 1 month ago

Thanks for the fix, look good to me overall, some comments:

  1. https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_listener.go#L56, I think we need to avoid pass the MutualAuthentication obj with the API even when the value is nil
  2. https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_listener.go#L161. Need to add a nil check for mutualAuthenticationAttributes
  3. can you pls also test this manually and add the test cases in the PR description? Thanks.
shraddhabang commented 1 month ago

/ok-to-test

shethyogita83 commented 1 month ago

Thanks for the fix, look good to me overall, some comments:

  1. https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_listener.go#L56, I think we need to avoid pass the MutualAuthentication obj with the API even when the value is nil
  2. https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_listener.go#L161. Need to add a nil check for mutualAuthenticationAttributes
  3. can you pls also test this manually and add the test cases in the PR description? Thanks.

Added tests for the same and also did manual testing by creating an alb without mutual auth annotation and with secure listeners port and protocol. Everything is working as expected.

oliviassss commented 1 month ago

@shethyogita83, thanks, how about these 2 comments?

  1. https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_listener.go#L56, I think we need to avoid pass the MutualAuthentication obj with the API even when the value is nil
  2. https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/model_build_listener.go#L161. Need to add a nil check for mutualAuthenticationAttributes

I think right now we are still passing the MutualAuthentication param (with nil value) to the API, if my understanding is correct, the param itself is not supported in the API for outposts and local zone? So it will still have issue when users deploy the controller in these zones? Unless I'm missing anything

shraddhabang commented 1 month ago

/ok-to-test