Skip to content

Commit d82b788

Browse files
authored
test: Fix tests on k8s 1.35 by applying the TrinoCatalog after the TrinoCluster (#907)
1 parent c30f332 commit d82b788

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

tests/templates/kuttl/iceberg-hive/34_trino.yaml.j2

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
---
22
apiVersion: trino.stackable.tech/v1alpha1
3+
kind: TrinoCatalog
4+
metadata:
5+
name: iceberg
6+
labels:
7+
trino: trino
8+
spec:
9+
connector:
10+
iceberg:
11+
metastore:
12+
configMap: hive
13+
s3:
14+
reference: minio
15+
hdfs:
16+
configMap: hdfs
17+
{% if test_scenario['values']['iceberg-use-kerberos'] == 'true' %}
18+
configOverrides:
19+
# HDFS configuration
20+
hive.hdfs.authentication.type: KERBEROS
21+
hive.hdfs.trino.principal: trino/trino.$NAMESPACE.svc.cluster.local@{{ test_scenario['values']['kerberos-realm'] }}
22+
hive.hdfs.trino.keytab: /stackable/kerberos/keytab
23+
hive.hdfs.impersonation.enabled: "false"
24+
hive.hdfs.wire-encryption.enabled: "true"
25+
# HMS configuration
26+
hive.metastore.authentication.type: KERBEROS
27+
hive.metastore.client.principal: trino/trino.$NAMESPACE.svc.cluster.local@{{ test_scenario['values']['kerberos-realm'] }}
28+
hive.metastore.client.keytab: /stackable/kerberos/keytab
29+
hive.metastore.service.principal: hive/hive.$NAMESPACE.svc.cluster.local@{{ test_scenario['values']['kerberos-realm'] }}
30+
hive.metastore.thrift.impersonation.enabled: "false"
31+
# By default, Hive views are executed with the RUN AS DEFINER security mode. Set the hive.hive-views.run-as-invoker catalog configuration property to true to use RUN AS INVOKER semantics.
32+
# However, this does *not* work for Iceberg catalogs :/ (I asked on the Trino slack: https://trinodb.slack.com/archives/CJ6UC075E/p1711449384648869)
33+
# hive.hive-views.run-as-invoker: "true"
34+
{% endif %}
35+
---
36+
apiVersion: trino.stackable.tech/v1alpha1
337
kind: TrinoCluster
438
metadata:
539
name: trino
@@ -71,37 +105,3 @@ spec:
71105
default:
72106
replicas: 1
73107
config: {}
74-
---
75-
apiVersion: trino.stackable.tech/v1alpha1
76-
kind: TrinoCatalog
77-
metadata:
78-
name: iceberg
79-
labels:
80-
trino: trino
81-
spec:
82-
connector:
83-
iceberg:
84-
metastore:
85-
configMap: hive
86-
s3:
87-
reference: minio
88-
hdfs:
89-
configMap: hdfs
90-
{% if test_scenario['values']['iceberg-use-kerberos'] == 'true' %}
91-
configOverrides:
92-
# HDFS configuration
93-
hive.hdfs.authentication.type: KERBEROS
94-
hive.hdfs.trino.principal: trino/trino.$NAMESPACE.svc.cluster.local@{{ test_scenario['values']['kerberos-realm'] }}
95-
hive.hdfs.trino.keytab: /stackable/kerberos/keytab
96-
hive.hdfs.impersonation.enabled: "false"
97-
hive.hdfs.wire-encryption.enabled: "true"
98-
# HMS configuration
99-
hive.metastore.authentication.type: KERBEROS
100-
hive.metastore.client.principal: trino/trino.$NAMESPACE.svc.cluster.local@{{ test_scenario['values']['kerberos-realm'] }}
101-
hive.metastore.client.keytab: /stackable/kerberos/keytab
102-
hive.metastore.service.principal: hive/hive.$NAMESPACE.svc.cluster.local@{{ test_scenario['values']['kerberos-realm'] }}
103-
hive.metastore.thrift.impersonation.enabled: "false"
104-
# By default, Hive views are executed with the RUN AS DEFINER security mode. Set the hive.hive-views.run-as-invoker catalog configuration property to true to use RUN AS INVOKER semantics.
105-
# However, this does *not* work for Iceberg catalogs :/ (I asked on the Trino slack: https://trinodb.slack.com/archives/CJ6UC075E/p1711449384648869)
106-
# hive.hive-views.run-as-invoker: "true"
107-
{% endif %}

tests/templates/kuttl/iceberg-rest/31_trino.yaml.j2

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
---
22
apiVersion: trino.stackable.tech/v1alpha1
3+
kind: TrinoCatalog
4+
metadata:
5+
name: lakehouse
6+
labels:
7+
trino: trino
8+
spec:
9+
connector:
10+
iceberg:
11+
s3:
12+
reference: minio
13+
configOverrides:
14+
iceberg.catalog.type: rest
15+
# We are using the headless service, as the hive-metastore service is missing port 9001
16+
iceberg.rest-catalog.uri: http://hive-metastore-default-headless:9001/iceberg
17+
iceberg.rest-catalog.security: OAUTH2
18+
iceberg.rest-catalog.oauth2.server-uri: https://keycloak.$NAMESPACE.svc.cluster.local:8443/realms/test/protocol/openid-connect/token
19+
# TODO Mount as env var from Secret trino-client-credentials
20+
iceberg.rest-catalog.oauth2.credential: trino:trino-secret
21+
---
22+
apiVersion: trino.stackable.tech/v1alpha1
323
kind: TrinoCluster
424
metadata:
525
name: trino
@@ -34,23 +54,3 @@ spec:
3454
roleGroups:
3555
default:
3656
replicas: 1
37-
---
38-
apiVersion: trino.stackable.tech/v1alpha1
39-
kind: TrinoCatalog
40-
metadata:
41-
name: lakehouse
42-
labels:
43-
trino: trino
44-
spec:
45-
connector:
46-
iceberg:
47-
s3:
48-
reference: minio
49-
configOverrides:
50-
iceberg.catalog.type: rest
51-
# We are using the headless service, as the hive-metastore service is missing port 9001
52-
iceberg.rest-catalog.uri: http://hive-metastore-default-headless:9001/iceberg
53-
iceberg.rest-catalog.security: OAUTH2
54-
iceberg.rest-catalog.oauth2.server-uri: https://keycloak.$NAMESPACE.svc.cluster.local:8443/realms/test/protocol/openid-connect/token
55-
# TODO Mount as env var from Secret trino-client-credentials
56-
iceberg.rest-catalog.oauth2.credential: trino:trino-secret

0 commit comments

Comments
 (0)