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

Fix IPv6 Compatibility for Backend #3557

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chaturvedi-kna
Copy link

@chaturvedi-kna chaturvedi-kna commented Dec 8, 2024

Description

This pull request addresses the issue [#3556] (#3556) by fixing two critical IPv6 compatibility problems in the ODH Dashboard backend:

  1. Dynamic IP Binding for Server:

    • Updated the backend server to dynamically detect and bind to an appropriate IP address.
    • The server now binds to :: by default, supporting IPv4, IPv6, and dual-stack environments.
    • Code changes were made in src/utils/constants.ts to handle dynamic IP detection.
  2. Proper Handling of IPv6 Hostnames in API Calls:

    • Fixed the API hostname validation issue where IPv6 addresses were not properly enclosed in square brackets ([]).
    • This resolves the Hostname/IP does not match certificate's altnames error observed in IPv6-only environments.
    • Code changes were made in src/plugins/kube.ts.

Why?

  • The changes are critical to ensure the dashboard operates in IPv6-only and dual-stack environments without errors.
  • These fixes also enhance compatibility for modern networking setups.

How Has This Been Tested?

The changes were tested in the following scenarios using ODH Operator version 2.13.1 on OpenShift 4.16:

  1. IPv6-Only Environment:
    • Verified that the backend successfully binds to ::.
    • Confirmed the resolution of hostname validation errors in API calls.

Test Impact

  • Manual validation in IPv6 environment ensures fix.

Request Review Criteria

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work.
  • Testing instructions have been added in the PR body.
  • The developer has added tests or explained why testing cannot be added (unit and API tests for backend changes).

If you have UI changes:

  • [n/a] No UI changes were made.

Testing Instructions

To test these changes:

  1. Deploy the dashboard backend using the custom PR image built for this branch.
  2. Test in IPv4, IPv6-only, and dual-stack environments:
    • IPv4: Confirm the server binds to 0.0.0.0.
    • IPv6: Confirm the server binds to :: and resolves API calls correctly.
    • Dual-Stack: Verify compatibility with both protocols.
  3. Validate the liveness and readiness probes:
    kubectl/oc get events -n

@openshift-ci openshift-ci bot requested review from dpanshug and pnaik1 December 8, 2024 20:11
Copy link
Contributor

openshift-ci bot commented Dec 8, 2024

Hi @chaturvedi-kna. Thanks for your PR.

I'm waiting for a opendatahub-io 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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI label Dec 8, 2024
@lucferbux
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test The openshift bot needs `ok-to-test` to allow non member PRs to run the tests. and removed needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI labels Dec 16, 2024
@chaturvedi-kna
Copy link
Author

I am updating this PR to sync with master

Copy link
Contributor

openshift-ci bot commented Dec 21, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lucferbux for approval. For more information see the 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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test The openshift bot needs `ok-to-test` to allow non member PRs to run the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants