Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kafka): expose schema registry and rest uris #563

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [MAJOR.MINOR.PATCH] - YYYY-MM-DD

- Check VPC for running services before deletion
- Expose `KAFKA_SCHEMA_REGISTRY_URI` and `KAFKA_REST_URI` to `Kafka` secret

## v0.16.0 - 2023-12-07

Expand Down
16 changes: 9 additions & 7 deletions controllers/kafka_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ func (a *kafkaAdapter) newSecret(ctx context.Context, s *aiven.Service) (*corev1

prefix := getSecretPrefix(a)
stringData := map[string]string{
prefix + "HOST": s.URIParams["host"],
prefix + "PORT": s.URIParams["port"],
prefix + "PASSWORD": password,
prefix + "USERNAME": userName,
prefix + "ACCESS_CERT": s.ConnectionInfo.KafkaAccessCert,
prefix + "ACCESS_KEY": s.ConnectionInfo.KafkaAccessKey,
prefix + "CA_CERT": caCert,
prefix + "HOST": s.URIParams["host"],
prefix + "PORT": s.URIParams["port"],
prefix + "PASSWORD": password,
prefix + "USERNAME": userName,
prefix + "ACCESS_CERT": s.ConnectionInfo.KafkaAccessCert,
prefix + "ACCESS_KEY": s.ConnectionInfo.KafkaAccessKey,
prefix + "REST_URI": s.ConnectionInfo.KafkaRestURI,
prefix + "SCHEMA_REGISTRY_URI": s.ConnectionInfo.SchemaRegistryURI,
prefix + "CA_CERT": caCert,
// todo: remove in future releases
"HOST": s.URIParams["host"],
"PORT": s.URIParams["port"],
Expand Down
2 changes: 2 additions & 0 deletions tests/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func TestKafka(t *testing.T) {

// Schema registry test
assert.Equal(t, anyPointer(true), ks.Spec.UserConfig.SchemaRegistry)
assert.NotEmpty(t, secret.Data["KAFKA_SCHEMA_REGISTRY_URI"])
assert.NotEmpty(t, secret.Data["KAFKA_SCHEMA_REGISTRY_HOST"])
assert.NotEmpty(t, secret.Data["KAFKA_SCHEMA_REGISTRY_PORT"])
assert.NotEqual(t, secret.Data["KAFKA_SCHEMA_REGISTRY_PORT"], secret.Data["KAFKA_PORT"])
Expand All @@ -143,6 +144,7 @@ func TestKafka(t *testing.T) {

// Kafka REST test
assert.Equal(t, anyPointer(true), ks.Spec.UserConfig.KafkaRest)
assert.NotEmpty(t, secret.Data["KAFKA_REST_URI"])
assert.NotEmpty(t, secret.Data["KAFKA_REST_HOST"])
assert.NotEmpty(t, secret.Data["KAFKA_REST_PORT"])
assert.NotEqual(t, secret.Data["KAFKA_REST_PORT"], secret.Data["KAFKA_PORT"])
Expand Down