Skip to content

Commit 9566549

Browse files
authored
chore: Fix tests, partially by fixing reporting-task (#818)
* chore: Fix tests, partially by fixing reporting-task * WIP * fix iceberg test
1 parent d737c4e commit 9566549

File tree

11 files changed

+19
-14
lines changed

11 files changed

+19
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file.
77
### Added
88

99
- Add rolling upgrade support for upgrades between NiFi 2 versions ([#771]).
10-
- BREAKING: Added Listener support for NiFi ([#784], [#819]).
10+
- BREAKING: Added Listener support for NiFi ([#784], [#818], [#819]).
1111
- Adds new telemetry CLI arguments and environment variables ([#782]).
1212
- Use `--file-log-max-files` (or `FILE_LOG_MAX_FILES`) to limit the number of log files kept.
1313
- Use `--file-log-rotation-period` (or `FILE_LOG_ROTATION_PERIOD`) to configure the frequency of rotation.
@@ -69,6 +69,7 @@ All notable changes to this project will be documented in this file.
6969
[#801]: https://github.com/stackabletech/nifi-operator/pull/801
7070
[#808]: https://github.com/stackabletech/nifi-operator/pull/808
7171
[#817]: https://github.com/stackabletech/nifi-operator/pull/817
72+
[#818]: https://github.com/stackabletech/nifi-operator/pull/818
7273
[#819]: https://github.com/stackabletech/nifi-operator/pull/819
7374

7475
## [25.3.0] - 2025-03-21

docs/modules/nifi/pages/usage_guide/monitoring.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ stringData:
9595
----
9696

9797
If you want to use a `ServiceMonitor` you'd need to configure it as follows:
98+
99+
// TODO: The ServiceMonitor should be switched to the -metrics service
100+
98101
[source,yaml]
99102
----
100103
---

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ async fn build_node_rolegroup_statefulset(
13501350
vec![&build_reporting_task_service_name(&nifi_cluster_name)],
13511351
SecretFormat::TlsPkcs12,
13521352
&requested_secret_lifetime,
1353-
LISTENER_VOLUME_NAME,
1353+
Some(LISTENER_VOLUME_NAME),
13541354
)
13551355
.context(SecuritySnafu)?,
13561356
)

rust/operator-binary/src/reporting_task/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ use stackable_operator::{
5151
use crate::{
5252
controller::build_recommended_labels,
5353
crd::{APP_NAME, HTTPS_PORT, HTTPS_PORT_NAME, METRICS_PORT, NifiRole, v1alpha1},
54-
listener::LISTENER_VOLUME_NAME,
5554
security::{
5655
authentication::{NifiAuthenticationConfig, STACKABLE_ADMIN_USERNAME},
5756
build_tls_volume,
@@ -357,7 +356,8 @@ fn build_reporting_task_job(
357356
// There is no correct way to configure this job since it's an implementation detail.
358357
// Also it will be dropped when support for 1.x is removed.
359358
&Duration::from_days_unchecked(1),
360-
LISTENER_VOLUME_NAME,
359+
// There is no listener volume we could get certs for
360+
None,
361361
)
362362
.context(SecretVolumeBuildFailureSnafu)?,
363363
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn build_tls_volume(
5050
service_scopes: Vec<&str>,
5151
secret_format: SecretFormat,
5252
requested_secret_lifetime: &Duration,
53-
listener_scope: &str,
53+
listener_scope: Option<&str>,
5454
) -> Result<Volume> {
5555
tls::build_tls_volume(
5656
nifi,

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,25 @@ pub(crate) fn build_tls_volume(
2727
service_scopes: Vec<&str>,
2828
secret_format: SecretFormat,
2929
requested_secret_lifetime: &Duration,
30-
listener_scope: &str,
30+
listener_scope: Option<&str>,
3131
) -> Result<Volume> {
3232
let mut secret_volume_source_builder =
3333
SecretOperatorVolumeSourceBuilder::new(nifi.server_tls_secret_class());
3434

3535
if secret_format == SecretFormat::TlsPkcs12 {
3636
secret_volume_source_builder.with_tls_pkcs12_password(STACKABLE_TLS_STORE_PASSWORD);
3737
}
38-
3938
for scope in service_scopes {
4039
secret_volume_source_builder.with_service_scope(scope);
4140
}
41+
if let Some(listener_scope) = listener_scope {
42+
secret_volume_source_builder.with_listener_volume_scope(listener_scope);
43+
}
4244

4345
Ok(VolumeBuilder::new(volume_name)
4446
.ephemeral(
4547
secret_volume_source_builder
4648
.with_pod_scope()
47-
.with_listener_volume_scope(listener_scope)
4849
.with_format(secret_format)
4950
.with_auto_tls_cert_lifetime(*requested_secret_lifetime)
5051
.build()

tests/templates/kuttl/iceberg/60_nifi-flow-with-kerberos.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@
653653
"properties": {
654654
"AWS Credentials Provider service": "d9e8d00a-c387-3064-add2-c6060f158ae7",
655655
"hadoop-config-resources": "/stackable/userdata/hdfs-config/core-site.xml,/stackable/userdata/hdfs-config/hdfs-site.xml,/stackable/userdata/hive-config/hive-site.xml",
656-
"hive-metastore-uri": "thrift://hive:9083",
656+
"hive-metastore-uri": "thrift://hive-metastore:9083",
657657
"s3-endpoint": "https://minio.${NAMESPACE}.svc.cluster.local:9000",
658658
"s3-path-style-access": "true",
659659
"warehouse-location": "s3a://demo/lakehouse"

tests/templates/kuttl/iceberg/60_nifi-flow-without-kerberos.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@
593593
"properties": {
594594
"AWS Credentials Provider service": "d9e8d00a-c387-3064-add2-c6060f158ae7",
595595
"hadoop-config-resources": "/stackable/userdata/hdfs-config/core-site.xml,/stackable/userdata/hdfs-config/hdfs-site.xml",
596-
"hive-metastore-uri": "thrift://hive:9083",
596+
"hive-metastore-uri": "thrift://hive-metastore:9083",
597597
"s3-endpoint": "https://minio.${NAMESPACE}.svc.cluster.local:9000",
598598
"s3-path-style-access": "true",
599599
"warehouse-location": "s3a://demo/lakehouse"

tests/templates/kuttl/iceberg/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ index 09783fa..23c679f 100644
2525
@@ -483,7 +485,7 @@
2626
"properties": {
2727
"AWS Credentials Provider service": "d9e8d00a-c387-3064-add2-c6060f158ae7",
28-
"hive-metastore-uri": "thrift://hive:9083",
28+
"hive-metastore-uri": "thrift://hive-metastore:9083",
2929
- "s3-endpoint": "https://minio.kuttl-test-patient-tarpon.svc.cluster.local:9000",
3030
+ "s3-endpoint": "https://minio.${NAMESPACE}.svc.cluster.local:9000",
3131
"s3-path-style-access": "true",

tests/templates/kuttl/smoke_v1/test_nifi_metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
port = args["port"]
4040
timeout = int(args["timeout"])
4141

42-
url = f"http://nifi-node-default-0.nifi-node-default-headless.{namespace}.svc.cluster.local:{port}/metrics"
42+
url = f"http://nifi-node-default-metrics.{namespace}.svc.cluster.local:{port}/metrics/"
4343

4444
# wait for 'timeout' seconds
4545
t_end = time.time() + timeout
4646
while time.time() < t_end:
4747
try:
48-
response = requests.post(url)
48+
response = requests.get(url)
4949
response.raise_for_status()
5050
if metric_name in response.text:
5151
print("Test metrics succeeded!")

0 commit comments

Comments
 (0)