Skip to content

Commit c6d1ce3

Browse files
committed
fix tests und role service name
1 parent 376aba0 commit c6d1ce3

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use stackable_operator::{
1717
merge::Merge,
1818
},
1919
k8s_openapi::apimachinery::pkg::api::resource::Quantity,
20-
kube::CustomResource,
20+
kube::{CustomResource, ResourceExt},
2121
product_config_utils::Configuration,
2222
product_logging::{self, spec::Logging},
2323
role_utils::{
@@ -326,7 +326,11 @@ impl v1alpha1::OpaCluster {
326326

327327
/// The name of the role-level load-balanced Kubernetes `Service`
328328
pub fn server_role_service_name(&self) -> Option<String> {
329-
self.metadata.name.clone()
329+
Some(format!(
330+
"{cluster_name}-{role}",
331+
cluster_name = self.name_any(),
332+
role = v1alpha1::OpaRole::Server
333+
))
330334
}
331335

332336
/// The fully-qualified domain name of the role-level load-balanced Kubernetes `Service`

tests/templates/kuttl/aas-user-info/30-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ kind: TestAssert
44
metadata:
55
name: test-regorule
66
commands:
7-
- script: kubectl exec -n $NAMESPACE test-regorule-0 -- python /tmp/test-regorule.py -u 'http://test-opa-server-default:8081/v1/data/test'
7+
- script: kubectl exec -n $NAMESPACE test-regorule-0 -- python /tmp/test-regorule.py -u 'http://test-opa-server:8081/v1/data/test'

tests/templates/kuttl/ad-user-info/30-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ kind: TestAssert
44
metadata:
55
name: test-regorule
66
commands:
7-
- script: kubectl exec -n $NAMESPACE test-regorule-0 -- python /tmp/test-regorule.py -u 'http://test-opa-server-default:8081/v1/data/test'
7+
- script: kubectl exec -n $NAMESPACE test-regorule-0 -- python /tmp/test-regorule.py -u 'http://test-opa-server:8081/v1/data/test'

tests/templates/kuttl/keycloak-user-info/30-assert.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ kind: TestAssert
44
metadata:
55
name: test-regorule
66
commands:
7-
- script: kubectl exec -n $NAMESPACE test-regorule-0 -- python /tmp/test-regorule.py -u 'http://test-opa-server-default:8081/v1/data/test'
7+
- script: kubectl exec -n $NAMESPACE test-regorule-0 -- python /tmp/test-regorule.py -u 'http://test-opa-server:8081/v1/data/test'

tests/templates/kuttl/smoke/30_test-metrics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env python
22
import requests
33

4-
# metrics_url = "http://test-opa-server-default:9504/metrics"
54
metrics_url = "http://test-opa-server-default-metrics:8081/metrics"
6-
# FIXME: Ideally this would be exposed via a metrics service (as the other operators do)
75
response = requests.get(metrics_url)
86

97
assert response.status_code == 200, "Metrics endpoint must return a 200 status code"

0 commit comments

Comments
 (0)