File tree 5 files changed +57
-4
lines changed
deploy/helm/trino-operator/crds
docs/modules/trino/pages/usage-guide/catalogs
5 files changed +57
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ All notable changes to this project will be documented in this file.
12
12
- Support configuring JVM arguments ([ #677 ] ).
13
13
- Aggregate emitted Kubernetes events on the CustomResources ([ #677 ] ).
14
14
- Support for Trino 470 ([ #705 ] ).
15
+ - Support removing properties from catalogs.
16
+ This is helpful, because Trino fails to start in case you have any unused config properties ([ #713 ] ).
15
17
- Support ` access-control.properties ` in configOverrides ([ #721 ] ).
16
18
17
19
### Changed
@@ -38,6 +40,7 @@ All notable changes to this project will be documented in this file.
38
40
[ #694 ] : https://github.com/stackabletech/trino-operator/pull/694
39
41
[ #695 ] : https://github.com/stackabletech/trino-operator/pull/695
40
42
[ #705 ] : https://github.com/stackabletech/trino-operator/pull/705
43
+ [ #713 ] : https://github.com/stackabletech/trino-operator/pull/713
41
44
[ #715 ] : https://github.com/stackabletech/trino-operator/pull/715
42
45
[ #717 ] : https://github.com/stackabletech/trino-operator/pull/717
43
46
[ #721 ] : https://github.com/stackabletech/trino-operator/pull/721
Original file line number Diff line number Diff line change @@ -2027,6 +2027,17 @@ spec:
2027
2027
description : A [TPC-H](https://docs.stackable.tech/home/nightly/trino/usage-guide/catalogs/tpch) connector.
2028
2028
type : object
2029
2029
type : object
2030
+ experimentalConfigRemovals :
2031
+ default : []
2032
+ description : |-
2033
+ List of config properties which should be removed.
2034
+
2035
+ This is helpful, because Trino fails to start in case you have any unused config properties. The removals are executed after the `configOverrides`.
2036
+
2037
+ This field is experimental, and might be replaced by a more generic mechanism to edit config properties
2038
+ items :
2039
+ type : string
2040
+ type : array
2030
2041
required :
2031
2042
- connector
2032
2043
type : object
Original file line number Diff line number Diff line change 31
31
accessStyle: Path
32
32
credentials:
33
33
secretClass: minio-credentials
34
- # We can use configOverrides to add arbitrary properties to the Trino catalog configuration
35
- configOverrides:
36
- hive.metastore.username: trino
37
34
---
38
35
apiVersion: trino.stackable.tech/v1alpha1
39
36
kind: TrinoCatalog
@@ -60,6 +57,29 @@ The `metadata.labels` are used by TrinoCluster to determine the link between Tri
60
57
The `spec.connector.<connector>` determines which connector is used.
61
58
Each connector supports a different set of attributes.
62
59
60
+ === Config overrides and config removals
61
+
62
+ You can use `.spec.configOverrides` to set arbitrary additional properties, which will be added to the catalog.
63
+
64
+ There is also `.spec.experimentalConfigRemovals` to remove any properties the operator might set, but are not used by Trino.
65
+ This causes Trino to refuse to startup with an error message such as `Error: Configuration property 'hive.s3.aws-access-key' was not used`.
66
+ By removing the unneeded properties you can get Trino to start again.
67
+
68
+ This example illustrates how to use config overrides and config removals
69
+
70
+ [source,yaml]
71
+ ----
72
+ apiVersion: trino.stackable.tech/v1alpha1
73
+ kind: TrinoCatalog
74
+ spec:
75
+ # Add some properties
76
+ configOverrides:
77
+ hive.metastore.username: trino
78
+ # Remove some properties
79
+ experimentalConfigRemovals:
80
+ - hive.s3.aws-access-key
81
+ ----
82
+
63
83
=== Add a catalog to a Trino cluster
64
84
65
85
It is necessary to specify within the TrinoCluster which catalogs it should use.
Original file line number Diff line number Diff line change @@ -161,6 +161,16 @@ impl CatalogConfig {
161
161
. properties
162
162
. extend ( catalog. spec . config_overrides . clone ( ) ) ;
163
163
164
+ for removal in & catalog. spec . config_removals {
165
+ if catalog_config. properties . remove ( removal) . is_none ( ) {
166
+ tracing:: warn!(
167
+ catalog. name = catalog_name,
168
+ property = removal,
169
+ "You asked to remove a non-existing config property from a catalog"
170
+ ) ;
171
+ }
172
+ }
173
+
164
174
Ok ( catalog_config)
165
175
}
166
176
}
Original file line number Diff line number Diff line change @@ -49,10 +49,19 @@ pub mod versioned {
49
49
/// The `connector` defines which connector is used.
50
50
pub connector : TrinoCatalogConnector ,
51
51
52
- #[ serde( default ) ]
53
52
/// The `configOverrides` allow overriding arbitrary Trino settings.
54
53
/// For example, for Hive you could add `hive.metastore.username: trino`.
54
+ #[ serde( default ) ]
55
55
pub config_overrides : HashMap < String , String > ,
56
+
57
+ /// List of config properties which should be removed.
58
+ ///
59
+ /// This is helpful, because Trino fails to start in case you have any unused config
60
+ /// properties. The removals are executed after the `configOverrides`.
61
+ ///
62
+ /// This field is experimental, and might be replaced by a more generic mechanism to edit config properties
63
+ #[ serde( default , rename = "experimentalConfigRemovals" ) ]
64
+ pub config_removals : Vec < String > ,
56
65
}
57
66
}
58
67
You can’t perform that action at this time.
0 commit comments