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

chore: add support for trino 455, remove old opa authorizer code #638

Merged
merged 7 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Added support for Trino 455 ([#638]).

### Changed

- Reduce CRD size from `984KB` to `131KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#631]):
Expand All @@ -15,9 +19,14 @@ All notable changes to this project will be documented in this file.
- Don't ignore envOverrides ([#633]).
- Don't print credentials to STDOUT during startup. Ideally we should use [config-utils](https://github.com/stackabletech/config-utils), but that's not easy (see [here](https://github.com/stackabletech/trino-operator/tree/fix/secret-printing)) ([#634]).

### Removed

- Removed support for Trino 414 and 442 ([#638]).

[#631]: https://github.com/stackabletech/trino-operator/pull/631
[#633]: https://github.com/stackabletech/trino-operator/pull/633
[#634]: https://github.com/stackabletech/trino-operator/pull/634
[#638]: https://github.com/stackabletech/trino-operator/pull/638

## [24.7.0] - 2024-07-24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
tls:
internalSecretClass: trino-internal-tls # <1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
tls:
serverSecretClass: trino-tls # <1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
tls:
serverSecretClass: trino-tls # <1>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/trino/pages/usage-guide/catalogs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
16 changes: 1 addition & 15 deletions docs/modules/trino/pages/usage-guide/security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,10 @@ NOTE: For a production setup you will use something much more granular.
We provide a detailed set of rego rules in our integration tests.
Details can be found below in the <<fine-granular-rego-rules, fine-granular rego rule>> section.

NOTE: Due to changes in the Trino OPA authorizer, rego rules differ between version 414 and newer versions.

[tabs]
====
414::
+
[source,yaml]
----
include::example$usage-guide/opa-bundle-trino-cm-414.yaml[]
----

Newer than 414::
+
[source,yaml]
----
include::example$usage-guide/opa-bundle-trino-cm-new.yaml[]
include::example$usage-guide/opa-bundle-trino-cm.yaml[]
----
====

Reference the package in the Trino cluster:

Expand Down
3 changes: 1 addition & 2 deletions docs/modules/trino/partials/supported-versions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
// This is a separate file, since it is used by both the direct Trino documentation, and the overarching
// Stackable Platform documentation.

- 455
- 451 (LTS)
- 442 (deprecated)
- 414 (deprecated)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
authentication:
- authenticationClass: simple-trino-users
Expand Down Expand Up @@ -66,22 +66,22 @@ data:
trino.rego: |
package trino

import future.keywords.in
import rego.v1

default allow = false

# Allow non-batched access
allow {
allow_if {
is_admin
}
# Allow batched access
extended[i] {
batch contains i if {
some i
input.action.filterResources[i]
is_admin
}
# Corner case: filtering columns is done with a single table item, and many columns inside
extended[i] {
batch contains i if {
some i
input.action.operation == "FilterColumns"
count(input.action.filterResources) == 1
Expand All @@ -90,22 +90,22 @@ data:
}

# Special rules for bob
allow {
allow if {
input.action.operation in ["ExecuteQuery", "AccessCatalog"]
is_bob
}
extended[i] {
batch contains i if {
input.action.operation in ["FilterCatalogs"]
some i
input.action.filterResources[i]
is_bob
}

is_admin() {
is_admin() if {
input.context.identity.user == "admin"
}

is_bob() {
is_bob() if {
input.context.identity.user == "bob"
}
---
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-trino-cluster-hive-ha-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-trino-cluster-resource-limits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
coordinators:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-trino-cluster-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-trino-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-trino-oauth2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ metadata:
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
authentication:
- authenticationClass: simple-trino-oidc
Expand Down
4 changes: 2 additions & 2 deletions rust/crd/src/affinity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down Expand Up @@ -199,7 +199,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector:
matchLabels:
Expand Down
20 changes: 10 additions & 10 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
"#;
Expand All @@ -890,7 +890,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
tls:
Expand All @@ -907,7 +907,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
tls:
Expand All @@ -925,7 +925,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
tls:
Expand All @@ -945,7 +945,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
"#;
Expand All @@ -960,7 +960,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
tls:
Expand All @@ -977,7 +977,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
tls:
Expand All @@ -998,7 +998,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
"#;
Expand All @@ -1018,7 +1018,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
workers:
Expand All @@ -1044,7 +1044,7 @@ mod tests {
name: simple-trino
spec:
image:
productVersion: "451"
productVersion: "455"
clusterConfig:
catalogLabelSelector: {}
workers:
Expand Down
Loading
Loading