Skip to content

Commit

Permalink
Bug fix: handle capitals in Kafka topics (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryannedolan authored Aug 31, 2023
1 parent 6e1b6c0 commit 5dc0c2b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import com.linkedin.hoptimator.catalog.Resource;

import java.util.Optional;
import java.util.Collections;
import java.util.Locale;
import java.util.Map;

class KafkaTopic extends Resource {
public KafkaTopic(String topicName, Map<String, String> clientOverrides) {
KafkaTopic(String topicName, Map<String, String> clientOverrides) {
super("KafkaTopic");
export("topicName", topicName);
export("topicNameLowerCase", topicName.toLowerCase(Locale.ROOT));
export("clientOverrides", clientOverrides);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import com.linkedin.hoptimator.catalog.Resource;

import java.util.Locale;

class KafkaTopicAcl extends Resource {
public KafkaTopicAcl(String topicName, String principal, String method) {
super("KafkaTopicAcl");
export("topicName", topicName);
export("topicNameLowerCase", topicName.toLowerCase(Locale.ROOT));
export("principal", principal);
export("method", method);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: hoptimator.linkedin.com/v1alpha1
kind: KafkaTopic
metadata:
name: {{topicName}}
name: {{topicNameLowerCase}}
namespace: {{pipeline.namespace}}
spec:
topicName: {{topicName}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: hoptimator.linkedin.com/v1alpha1
kind: Acl
metadata:
name: {{topicName}}-acl-{{id}}
name: {{topicNameLowerCase}}-acl-{{id}}
namespace: {{pipeline.namespace}}
spec:
resource:
kind: KafkaTopic
name: {{topicName}}
name: {{topicNameLowerCase}}
method: {{method}}
principal: {{principal}}

0 comments on commit 5dc0c2b

Please sign in to comment.