35
35
import io .strimzi .api .kafka .model .kafka .cruisecontrol .CruiseControlTemplate ;
36
36
import io .strimzi .certs .CertAndKey ;
37
37
import io .strimzi .operator .cluster .ClusterOperatorConfig ;
38
- import io .strimzi .operator .cluster .model .cruisecontrol .Capacity ;
38
+ import io .strimzi .operator .cluster .model .cruisecontrol .CapacityConfiguration ;
39
39
import io .strimzi .operator .cluster .model .cruisecontrol .CruiseControlConfiguration ;
40
40
import io .strimzi .operator .cluster .model .cruisecontrol .HashLoginServiceApiCredentials ;
41
41
import io .strimzi .operator .cluster .model .logging .LoggingModel ;
@@ -111,7 +111,7 @@ public class CruiseControl extends AbstractModel implements SupportsMetrics, Sup
111
111
private boolean authEnabled ;
112
112
private HashLoginServiceApiCredentials apiCredentials ;
113
113
@ SuppressFBWarnings ({"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" }) // This field is initialized in the fromCrd method
114
- protected Capacity capacity ;
114
+ protected CapacityConfiguration capacityConfiguration ;
115
115
@ SuppressFBWarnings ({"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR" }) // This field is initialized in the fromCrd method
116
116
private MetricsModel metrics ;
117
117
private LoggingModel logging ;
@@ -197,6 +197,7 @@ public static CruiseControl fromCrd(
197
197
result .image = image ;
198
198
199
199
KafkaConfiguration kafkaConfiguration = new KafkaConfiguration (reconciliation , kafkaClusterSpec .getConfig ().entrySet ());
200
+ result .capacityConfiguration = new CapacityConfiguration (reconciliation , kafkaCr .getSpec (), kafkaBrokerNodes , kafkaStorage , kafkaBrokerResources );
200
201
result .updateConfigurationWithDefaults (ccSpec , kafkaConfiguration );
201
202
202
203
CruiseControlConfiguration ccConfiguration = result .configuration ;
@@ -207,7 +208,6 @@ public static CruiseControl fromCrd(
207
208
208
209
// To avoid illegal storage configurations provided by the user,
209
210
// we rely on the storage configuration provided by the KafkaAssemblyOperator
210
- result .capacity = new Capacity (reconciliation , kafkaCr .getSpec (), kafkaBrokerNodes , kafkaStorage , kafkaBrokerResources );
211
211
result .readinessProbeOptions = ProbeUtils .extractReadinessProbeOptionsOrDefault (ccSpec , ProbeUtils .DEFAULT_HEALTHCHECK_OPTIONS );
212
212
result .livenessProbeOptions = ProbeUtils .extractLivenessProbeOptionsOrDefault (ccSpec , ProbeUtils .DEFAULT_HEALTHCHECK_OPTIONS );
213
213
result .gcLoggingEnabled = ccSpec .getJvmOptions () == null ? JvmOptions .DEFAULT_GC_LOGGING_ENABLED : ccSpec .getJvmOptions ().isGcLoggingEnabled ();
@@ -530,7 +530,7 @@ public LoggingModel logging() {
530
530
public ConfigMap generateConfigMap (MetricsAndLogging metricsAndLogging ) {
531
531
Map <String , String > configMapData = new HashMap <>();
532
532
configMapData .put (SERVER_CONFIG_FILENAME , configuration .asOrderedProperties ().asPairs ());
533
- configMapData .put (CAPACITY_CONFIG_FILENAME , capacity .toString ());
533
+ configMapData .put (CAPACITY_CONFIG_FILENAME , capacityConfiguration .toString ());
534
534
configMapData .putAll (ConfigMapUtils .generateMetricsAndLogConfigMapData (reconciliation , this , metricsAndLogging ));
535
535
536
536
return ConfigMapUtils
0 commit comments