Skip to content

Commit c91a041

Browse files
committed
Remove unused KafkaTlsSecurity::kafka
1 parent acb686e commit c91a041

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

rust/crd/src/listener.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ mod tests {
240240
"#;
241241
let kafka: KafkaCluster = serde_yaml::from_str(kafka_cluster).expect("illegal test input");
242242
let kafka_security = KafkaTlsSecurity::new(
243-
&kafka,
244243
ResolvedAuthenticationClasses::new(vec![AuthenticationClass {
245244
metadata: ObjectMetaBuilder::new().name("auth-class").build(),
246245
spec: AuthenticationClassSpec {
@@ -310,7 +309,6 @@ mod tests {
310309
"#;
311310
let kafka: KafkaCluster = serde_yaml::from_str(input).expect("illegal test input");
312311
let kafka_security = KafkaTlsSecurity::new(
313-
&kafka,
314312
ResolvedAuthenticationClasses::new(vec![]),
315313
"tls".to_string(),
316314
Some("tls".to_string()),
@@ -375,7 +373,6 @@ mod tests {
375373
"#;
376374
let kafka: KafkaCluster = serde_yaml::from_str(input).expect("illegal test input");
377375
let kafka_security = KafkaTlsSecurity::new(
378-
&kafka,
379376
ResolvedAuthenticationClasses::new(vec![]),
380377
"".to_string(),
381378
None,

rust/crd/src/security.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ pub enum Error {
4343
}
4444

4545
/// Helper struct combining TLS settings for server and internal with the resolved AuthenticationClasses
46-
pub struct KafkaTlsSecurity<'a> {
47-
kafka: &'a KafkaCluster,
46+
pub struct KafkaTlsSecurity {
4847
resolved_authentication_classes: ResolvedAuthenticationClasses,
4948
internal_secret_class: String,
5049
server_secret_class: Option<String>,
5150
}
5251

53-
impl<'a> KafkaTlsSecurity<'a> {
52+
impl KafkaTlsSecurity {
5453
// ports
5554
pub const CLIENT_PORT_NAME: &'static str = "kafka";
5655
pub const CLIENT_PORT: u16 = 9092;
@@ -108,13 +107,11 @@ impl<'a> KafkaTlsSecurity<'a> {
108107

109108
#[cfg(test)]
110109
pub fn new(
111-
kafka: &'a KafkaCluster,
112110
resolved_authentication_classes: ResolvedAuthenticationClasses,
113111
internal_secret_class: String,
114112
server_secret_class: Option<String>,
115113
) -> Self {
116114
Self {
117-
kafka,
118115
resolved_authentication_classes,
119116
internal_secret_class,
120117
server_secret_class,
@@ -125,10 +122,9 @@ impl<'a> KafkaTlsSecurity<'a> {
125122
/// all provided `AuthenticationClass` references.
126123
pub async fn new_from_kafka_cluster(
127124
client: &Client,
128-
kafka: &'a KafkaCluster,
125+
kafka: &KafkaCluster,
129126
) -> Result<Self, Error> {
130127
Ok(KafkaTlsSecurity {
131-
kafka,
132128
resolved_authentication_classes: ResolvedAuthenticationClasses::from_references(
133129
client,
134130
&kafka.spec.cluster_config.authentication,

rust/operator-binary/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub async fn build_discovery_configmaps(
5656
kafka: &KafkaCluster,
5757
owner: &impl Resource<DynamicType = ()>,
5858
resolved_product_image: &ResolvedProductImage,
59-
kafka_security: &KafkaTlsSecurity<'_>,
59+
kafka_security: &KafkaTlsSecurity,
6060
listener: &Listener,
6161
) -> Result<Vec<ConfigMap>, Error> {
6262
let name = owner.name_unchecked();

0 commit comments

Comments
 (0)