Skip to content

Commit 33edc09

Browse files
committed
kafka: check ct enabled in topic create validation
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
1 parent a9cf1cc commit 33edc09

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/v/kafka/server/handlers/topics/validators.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ struct storage_mode_config_validator {
546546
"'tiered' requires cloud storage to be enabled.";
547547
static constexpr error_code ec = error_code::invalid_config;
548548

549-
static bool is_valid(const creatable_topic& c, features::feature_table*) {
549+
static bool
550+
is_valid(const creatable_topic& c, features::feature_table* ft) {
550551
auto it = std::find_if(
551552
c.configs.begin(),
552553
c.configs.end(),
@@ -566,6 +567,11 @@ struct storage_mode_config_validator {
566567
case model::redpanda_storage_mode::tiered:
567568
return config::shard_local_cfg().cloud_storage_enabled();
568569
case model::redpanda_storage_mode::cloud:
570+
if (
571+
ft == nullptr
572+
|| !ft->is_active(features::feature::cloud_topics)) {
573+
return false;
574+
}
569575
return config::shard_local_cfg().cloud_topics_enabled();
570576
case model::redpanda_storage_mode::unset:
571577
// unset is always valid - actual behavior depends on

0 commit comments

Comments
 (0)