Skip to content

Commit

Permalink
cluster: Switch license strings
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Pope <ben@redpanda.com>
  • Loading branch information
BenPope committed Nov 25, 2024
1 parent fb700d9 commit f599d83
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/v/cluster/partition_balancer_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "cluster/types.h"
#include "config/configuration.h"
#include "config/property.h"
#include "features/enterprise_feature_messages.h"
#include "features/enterprise_features.h"
#include "features/feature_table.h"
#include "model/metadata.h"
Expand Down Expand Up @@ -370,9 +371,9 @@ ss::future<> partition_balancer_backend::do_tick() {
if (is_sanctioned) {
vlog(
clusterlog.warn,
"A Redpanda Enterprise Edition license is required to use enterprise "
"feature \"partition_autobalancing_mode\" with value \"{}\". "
"Behavior is being restricted to \"{}\".",
"{}",
features::enterprise_error_message::
partition_autobalancing_continuous(),
_mode(false).first,
mode);
}
Expand Down
8 changes: 2 additions & 6 deletions src/v/cluster/scheduling/leader_balancer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "config/configuration.h"
#include "config/node_config.h"
#include "container/fragmented_vector.h"
#include "features/enterprise_feature_messages.h"
#include "model/metadata.h"
#include "model/namespace.h"
#include "raft/rpc_client_protocol.h"
Expand Down Expand Up @@ -465,12 +466,7 @@ bool leader_balancer::leadership_pinning_enabled() const {
vlog(
clusterlog.warn,
"{}",
"A Redpanda Enterprise Edition license is required to use the "
"enterprise feature \"leadership pinning\". This feature is "
"disabled. The values of the cluster property \"{}\" and the "
"topic property \"redpanda.leaders.preference\" are being "
"ignored.",
config::shard_local_cfg().default_leaders_preference.name());
features::enterprise_error_message::default_leaders_preference());
}
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions src/v/cluster/security_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "cluster/logger.h"
#include "cluster/partition_leaders_table.h"
#include "cluster/types.h"
#include "features/enterprise_feature_messages.h"
#include "model/errc.h"
#include "model/metadata.h"
#include "model/namespace.h"
Expand Down Expand Up @@ -235,8 +236,8 @@ ss::future<std::vector<errc>> security_frontend::do_create_acls(
err = errc::feature_disabled;
vlog(
clusterlog.warn,
"An enterprise license is required to create an ACL with a role "
"binding");
"{}",
features::enterprise_error_message::acl_with_rbac());
} else {
try {
create_acls_cmd_data data;
Expand Down
6 changes: 3 additions & 3 deletions src/v/cluster/shard_balancer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "cluster/cluster_utils.h"
#include "cluster/logger.h"
#include "config/node_config.h"
#include "features/enterprise_feature_messages.h"
#include "features/enterprise_features.h"
#include "random/generators.h"
#include "ssx/async_algorithm.h"
Expand Down Expand Up @@ -469,9 +470,8 @@ void shard_balancer::maybe_assign(
if (is_sanctioned) {
vlog(
clusterlog.warn,
"A Redpanda Enterprise Edition license is required to use "
"enterprise feature \"core_balancing_continuous\". "
"This property is being ignored.");
"{}",
features::enterprise_error_message::core_balancing_continuous());
}

if (
Expand Down
12 changes: 5 additions & 7 deletions src/v/cluster/topics_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "config/configuration.h"
#include "config/leaders_preference.h"
#include "data_migration_types.h"
#include "features/enterprise_feature_messages.h"
#include "features/feature_table.h"
#include "fwd.h"
#include "model/errc.h"
Expand Down Expand Up @@ -428,8 +429,8 @@ ss::future<std::vector<topic_result>> topics_frontend::update_topic_properties(
&& is_user_topic(update.tp_ns)) {
if (auto f = get_enterprise_features(_metadata_cache, update);
!f.empty()) {
auto msg = ssx::sformat(
"An enterprise license is required to enable {}.", f);
auto msg
= features::enterprise_error_message::topic_property(f);
vlog(clusterlog.warn, "{}", msg);
return ss::make_ready_future<topic_result>(topic_result(
update.tp_ns,
Expand Down Expand Up @@ -609,8 +610,7 @@ topic_result topics_frontend::validate_topic_configuration(
&& is_user_topic(assignable_config.cfg.tp_ns)) {
if (auto f = get_enterprise_features(assignable_config.cfg);
!f.empty()) {
auto msg = ssx::sformat(
"An enterprise license is required to enable {}.", f);
auto msg = features::enterprise_error_message::topic_property(f);
vlog(clusterlog.warn, "{}", msg);
return make_result(errc::topic_invalid_config, std::move(msg));
}
Expand Down Expand Up @@ -1635,9 +1635,7 @@ ss::future<topic_result> topics_frontend::do_create_partition(

if (_features.local().should_sanction() && is_user_topic(tp_cfg->tp_ns)) {
if (auto f = get_enterprise_features(*tp_cfg); !f.empty()) {
auto msg = ssx::sformat(
"An enterprise license is required to create partitions with {}.",
f);
auto msg = features::enterprise_error_message::create_partition(f);
vlog(clusterlog.warn, "{}", msg);
co_return make_error_result(
p_cfg.tp_ns, errc::topic_invalid_config, std::move(msg));
Expand Down

0 comments on commit f599d83

Please sign in to comment.