Skip to content

Allow empty config values to fallback to cluster defaults#2885

Open
yunasora wants to merge 3 commits into
tchiotludo:devfrom
yunasora:dev
Open

Allow empty config values to fallback to cluster defaults#2885
yunasora wants to merge 3 commits into
tchiotludo:devfrom
yunasora:dev

Conversation

@yunasora

Copy link
Copy Markdown

Fixes #2601

When creating a new topic, if a user leaves cleanup.policy or retention blank (intending to use the cluster's default settings), the process previously failed. This PR fixes the issue across both the frontend and backend.

Changes made:

  1. Backend: Added a .filter() in the controller to remove empty configuration values ("") from the request payload, preventing Kafka from rejecting them.
  2. Frontend: Updated the Joi validation schema in TopicCreate.jsx to .allow('') for the retention field, ensuring the UI doesn't block the submission when the field is cleared.

Testing:

  • Verified locally that leaving Retention blank successfully creates the topic using the cluster default configuration.
  • Passed all CI tests.

@AlexisSouquiere AlexisSouquiere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please revert your changes on the package-lock.json and application.yml files

@github-project-automation github-project-automation Bot moved this from Backlog to In progress in Backlog May 13, 2026
(configs != null ? configs : ImmutableMap.<String, String>of())
.entrySet()
.stream()
// Triggering GitHub Actions for testing #2601

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove this comment

.entrySet()
.stream()
// Triggering GitHub Actions for testing #2601
.filter(r -> r.getValue()!=null&&!r.getValue().isEmpty())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please reformat this line

@@ -38,7 +38,7 @@ class TopicCreate extends Form {
partition: Joi.number().min(1).label('Partition').required(),
replication: Joi.number().min(1).label('Replication').required(),
cleanup: Joi.string().required(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

allow('') should be there too to allow not sending cleanup policy

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

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Allow Cleanup Policy & Retention to Be Empty to Use Cluster Defaults During Topic Creation

2 participants