Skip to content

Conversation

@ahmedtoumi
Copy link

@ahmedtoumi ahmedtoumi commented Oct 2, 2025

Change Description

  • Context: During the preflight ensure step, the full property set is parsed so SASL can be validated. When configs reference a Config Provider, Kafka's AbstractConfig.instantiateConfigProviders is triggered and attempts to load the provider classes.
  • Problem: The provider implementation may not be on the CUB classpath, causing preflight to fail before the service starts.
  • Workaround: todays two not clean workarounds exists :
    -- Overriding CUB_CLASSPATH like /usr/share/java/cp-base-new/*:PATH_TO_CONFIG_PROVIDER_JARS
    -- Copying the config provider jars inside /usr/share/java/cp-base-new/

check issue #111

  • Change: Add CUB_CLASSPATH_DIRS and honor explicit CUB_CLASSPATH so provider JARs can be supplied to the preflight classpath without losing defaults.
  • Result: Preflight succeeds when using SASL with config providers, provided the provider JARs are added via CUB_CLASSPATH or CUB_CLASSPATH_DIRS. No behavior change when not using config providers.

Testing

unit tests created at test/test_classpath.py

ahmed.toumi-ext added 2 commits October 2, 2025 16:02
@ahmedtoumi ahmedtoumi requested a review from a team as a code owner October 2, 2025 22:19
Copilot AI review requested due to automatic review settings October 2, 2025 22:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for extending the Java CLASSPATH in the CUB (Confluent Utility Belt) to resolve issues with SASL config providers during preflight validation. The change introduces a new CUB_CLASSPATH_DIRS environment variable that allows appending additional directories to the classpath without losing the default base paths.

Key changes:

  • Introduces CUB_CLASSPATH_DIRS environment variable with flexible delimiter support (:, ;, ,)
  • Adds automatic wildcard normalization for directory paths to include all JARs
  • Maintains backward compatibility with existing CUB_CLASSPATH and CUB_EXTRA_CLASSPATH variables

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
confluent/docker_utils/cub.py Core implementation of classpath building logic with new environment variable support
test/test_classpath.py Comprehensive unit tests covering various classpath scenarios and edge cases
docs/CHANGELOG.rst Documents the new feature in the unreleased section
README.md Adds detailed documentation and usage examples for the new classpath functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

check only linux file separator

Co-authored-by: Copilot <[email protected]>
@ahmedtoumi ahmedtoumi requested a review from Copilot October 2, 2025 22:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@etech-data etech-data left a comment

Choose a reason for hiding this comment

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

test localy passes

image

different use cases handled at _build_classpath (cub.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants