Skip to content

Commit 78eb128

Browse files
chore: Comment the usages of SecretClassVolumeProvisionParts
1 parent 8ae1c5f commit 78eb128

4 files changed

Lines changed: 20 additions & 16 deletions

File tree

rust/operator-binary/src/config/jvm.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ pub enum Error {
2727
}
2828

2929
/// All JVM arguments.
30-
fn construct_jvm_args<ConfigFragment, ConfigOverrides: Default + JsonSchema + Serialize>(
30+
fn construct_jvm_args<ConfigFragment, ConfigOverrides>(
3131
merged_config: &AnyConfig,
3232
role: &Role<ConfigFragment, ConfigOverrides, GenericRoleConfig, JavaCommonConfig>,
3333
role_group: &str,
34-
) -> Result<Vec<String>, Error> {
34+
) -> Result<Vec<String>, Error>
35+
where
36+
ConfigOverrides: Default + JsonSchema + Serialize,
37+
{
3538
let heap_size = MemoryQuantity::try_from(
3639
merged_config
3740
.resources()
@@ -69,14 +72,14 @@ fn construct_jvm_args<ConfigFragment, ConfigOverrides: Default + JsonSchema + Se
6972

7073
/// Arguments that go into `EXTRA_ARGS`, so *not* the heap settings (which you can get using
7174
/// [`construct_heap_jvm_args`]).
72-
pub fn construct_non_heap_jvm_args<
73-
ConfigFragment,
74-
ConfigOverrides: Default + JsonSchema + Serialize,
75-
>(
75+
pub fn construct_non_heap_jvm_args<ConfigFragment, ConfigOverrides>(
7676
merged_config: &AnyConfig,
7777
role: &Role<ConfigFragment, ConfigOverrides, GenericRoleConfig, JavaCommonConfig>,
7878
role_group: &str,
79-
) -> Result<String, Error> {
79+
) -> Result<String, Error>
80+
where
81+
ConfigOverrides: Default + JsonSchema + Serialize,
82+
{
8083
let mut jvm_args = construct_jvm_args(merged_config, role, role_group)?;
8184
jvm_args.retain(|arg| !is_heap_jvm_argument(arg));
8285

rust/operator-binary/src/crd/role/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use strum::{Display, EnumIter, EnumString, IntoEnumIterator};
2323
use crate::{
2424
config::jvm::{construct_heap_jvm_args, construct_non_heap_jvm_args},
2525
crd::role::{
26-
broker::{BROKER_PROPERTIES_FILE, BrokerConfig, BrokerConfigFragment},
26+
broker::{BROKER_PROPERTIES_FILE, BrokerConfig},
2727
commons::{CommonConfig, Storage},
2828
controller::{CONTROLLER_PROPERTIES_FILE, ControllerConfig},
2929
},
@@ -226,10 +226,7 @@ impl KafkaRole {
226226
rolegroup: &str,
227227
) -> Result<String, Error> {
228228
match self {
229-
Self::Broker => construct_non_heap_jvm_args::<
230-
BrokerConfigFragment,
231-
v1alpha1::KafkaBrokerConfigOverrides,
232-
>(
229+
Self::Broker => construct_non_heap_jvm_args(
233230
merged_config,
234231
kafka.broker_role().with_context(|_| MissingRoleSnafu {
235232
role: self.to_string(),
@@ -255,10 +252,7 @@ impl KafkaRole {
255252
rolegroup: &str,
256253
) -> Result<String, Error> {
257254
match self {
258-
Self::Broker => construct_heap_jvm_args::<
259-
BrokerConfigFragment,
260-
v1alpha1::KafkaBrokerConfigOverrides,
261-
>(
255+
Self::Broker => construct_heap_jvm_args(
262256
merged_config,
263257
kafka.broker_role().with_context(|_| MissingRoleSnafu {
264258
role: self.to_string(),

rust/operator-binary/src/crd/security.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ impl KafkaTlsSecurity {
527527
.ephemeral(
528528
SecretOperatorVolumeSourceBuilder::new(
529529
secret_class,
530+
// Only the truststore is required to connect to OPA.
530531
SecretClassVolumeProvisionParts::Public,
531532
)
532533
.build()
@@ -555,6 +556,8 @@ impl KafkaTlsSecurity {
555556
.ephemeral(
556557
SecretOperatorVolumeSourceBuilder::new(
557558
tls_internal_secret_class,
559+
// Kafka needs both the public certificate and the private key for
560+
// the internal communication.
558561
SecretClassVolumeProvisionParts::PublicPrivate,
559562
)
560563
.with_pod_scope()
@@ -854,6 +857,8 @@ impl KafkaTlsSecurity {
854857
.ephemeral(
855858
SecretOperatorVolumeSourceBuilder::new(
856859
secret_class_name,
860+
// Both the public certificate and the private key are required for the kcat
861+
// client authentication.
857862
SecretClassVolumeProvisionParts::PublicPrivate,
858863
)
859864
.with_pod_scope()
@@ -875,6 +880,7 @@ impl KafkaTlsSecurity {
875880
.ephemeral(
876881
SecretOperatorVolumeSourceBuilder::new(
877882
secret_class_name,
883+
// Both the keystore and truststore are required for keystore volume.
878884
SecretClassVolumeProvisionParts::PublicPrivate,
879885
)
880886
.with_pod_scope()

rust/operator-binary/src/kerberos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub fn add_kerberos_pod_config(
4646
// Mount keytab
4747
let kerberos_secret_operator_volume = SecretOperatorVolumeSourceBuilder::new(
4848
kerberos_secret_class,
49+
// We need both public (krb5.conf) and private (keytab) parts.
4950
SecretClassVolumeProvisionParts::PublicPrivate,
5051
)
5152
.with_listener_volume_scope(LISTENER_BROKER_VOLUME_NAME)

0 commit comments

Comments
 (0)