From 90ce8b52d98bb0063eda593c8e10a6534e7d5aea Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Thu, 23 Jan 2025 14:17:30 +0100 Subject: [PATCH 1/9] chore(opa): Bump to 1.0.0 --- tests/templates/kuttl/smoke/10-install-opa.yaml.j2 | 4 ++-- tests/templates/kuttl/smoke/test-regorule.py | 2 +- tests/test-definition.yaml | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 b/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 index cc96013b..78b443bb 100644 --- a/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 @@ -9,11 +9,11 @@ data: test.rego: | package test - hello { + hello if { true } - world { + world if { false } --- diff --git a/tests/templates/kuttl/smoke/test-regorule.py b/tests/templates/kuttl/smoke/test-regorule.py index 0727ae8e..a3991acd 100755 --- a/tests/templates/kuttl/smoke/test-regorule.py +++ b/tests/templates/kuttl/smoke/test-regorule.py @@ -27,7 +27,7 @@ # --> {'hello': True} # url = 'http://test-opa-svc:8081/v1/data/test' - response = requests.post(args['url']).json() + response = requests.post(args['url'], json={"input": {}}).json() if "result" in response and "hello" in response["result"] and response["result"]["hello"]: print("Test successful!") diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 0ec62395..c356262d 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -3,12 +3,11 @@ dimensions: - name: opa values: # To use a custom image, add a comma and the full name after the product version - - 0.67.1,docker.stackable.tech/stackable/opa:0.67.1-stackable0.0.0-dev - - 0.66.0,docker.stackable.tech/stackable/opa:0.66.0-stackable0.0.0-dev + - 1.0.0 - name: opa-latest values: # To use a custom image, add a comma and the full name after the product version - - 0.67.1,docker.stackable.tech/stackable/opa:0.67.1-stackable0.0.0-dev + - 1.0.0 - name: keycloak values: - 23.0.1 From 8d48769e6fb97cd5391c7236b03b4fceac8d989f Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Thu, 23 Jan 2025 14:21:17 +0100 Subject: [PATCH 2/9] Adding 0.67.1 dismissed by accident --- tests/test-definition.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index c356262d..a8ecd636 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -3,6 +3,7 @@ dimensions: - name: opa values: # To use a custom image, add a comma and the full name after the product version + - 0.67.1 - 1.0.0 - name: opa-latest values: From abe9c8b3ba92f5c93ac5053d2f99d436d6385763 Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Thu, 23 Jan 2025 14:26:15 +0100 Subject: [PATCH 3/9] Updating Changelog.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb9204d3..ba1e4692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Run a `containerdebug` process in the background of each OPA container to collect debugging information ([#666]). +- Added support for OPA 1.0.0 ([#677]) ### Fixed @@ -14,8 +15,13 @@ All notable changes to this project will be documented in this file. deployed in one namespace. Existing Stacklets will use the newly created ServiceAccounts after restart ([#656]). +### Removed + +- remove support for OPA 0.66.0 ([#677]) + [#656]: https://github.com/stackabletech/opa-operator/pull/656 [#666]: https://github.com/stackabletech/opa-operator/pull/666 +[#677]: https://github.com/stackabletech/opa-operator/pull/677 ## [24.11.0] - 2024-11-18 From 49dc59a63900ea922e6c7fe8dfdfb3ef0de9e85a Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Thu, 23 Jan 2025 14:34:50 +0100 Subject: [PATCH 4/9] Updating getting_started --- docs/modules/opa/examples/getting_started/getting_started.sh | 4 ++-- .../opa/examples/getting_started/getting_started.sh.j2 | 4 ++-- docs/modules/opa/examples/getting_started/opa.yaml | 2 +- docs/modules/opa/examples/getting_started/opa.yaml.j2 | 2 +- docs/modules/opa/examples/getting_started/simple-rule.yaml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/modules/opa/examples/getting_started/getting_started.sh b/docs/modules/opa/examples/getting_started/getting_started.sh index 317b53c8..ef33dd75 100755 --- a/docs/modules/opa/examples/getting_started/getting_started.sh +++ b/docs/modules/opa/examples/getting_started/getting_started.sh @@ -74,7 +74,7 @@ sleep 5 request_hello() { # tag::request-hello[] -curl -s http://localhost:8081/v1/data/test/hello +curl -s http://localhost:8081/v1/data/test/hello -d '{"input": {}}' # end::request-hello[] } @@ -91,7 +91,7 @@ fi request_world() { # tag::request-world[] -curl -s http://localhost:8081/v1/data/test/world +curl -s http://localhost:8081/v1/data/test/world -d '{"input": {}}' # end::request-world[] } diff --git a/docs/modules/opa/examples/getting_started/getting_started.sh.j2 b/docs/modules/opa/examples/getting_started/getting_started.sh.j2 index fdf90955..17648844 100755 --- a/docs/modules/opa/examples/getting_started/getting_started.sh.j2 +++ b/docs/modules/opa/examples/getting_started/getting_started.sh.j2 @@ -74,7 +74,7 @@ sleep 5 request_hello() { # tag::request-hello[] -curl -s http://localhost:8081/v1/data/test/hello +curl -s http://localhost:8081/v1/data/test/hello -d '{"input": {}}' # end::request-hello[] } @@ -91,7 +91,7 @@ fi request_world() { # tag::request-world[] -curl -s http://localhost:8081/v1/data/test/world +curl -s http://localhost:8081/v1/data/test/world -d '{"input": {}}' # end::request-world[] } diff --git a/docs/modules/opa/examples/getting_started/opa.yaml b/docs/modules/opa/examples/getting_started/opa.yaml index c1853f64..b2e191cd 100644 --- a/docs/modules/opa/examples/getting_started/opa.yaml +++ b/docs/modules/opa/examples/getting_started/opa.yaml @@ -5,7 +5,7 @@ metadata: name: simple-opa spec: image: - productVersion: "0.67.1" + productVersion: "1.0.0" servers: roleGroups: default: {} diff --git a/docs/modules/opa/examples/getting_started/opa.yaml.j2 b/docs/modules/opa/examples/getting_started/opa.yaml.j2 index c1853f64..b2e191cd 100644 --- a/docs/modules/opa/examples/getting_started/opa.yaml.j2 +++ b/docs/modules/opa/examples/getting_started/opa.yaml.j2 @@ -5,7 +5,7 @@ metadata: name: simple-opa spec: image: - productVersion: "0.67.1" + productVersion: "1.0.0" servers: roleGroups: default: {} diff --git a/docs/modules/opa/examples/getting_started/simple-rule.yaml b/docs/modules/opa/examples/getting_started/simple-rule.yaml index 3a3914aa..3d1ce379 100644 --- a/docs/modules/opa/examples/getting_started/simple-rule.yaml +++ b/docs/modules/opa/examples/getting_started/simple-rule.yaml @@ -9,10 +9,10 @@ data: test.rego: | package test - hello { + hello if { true } - world { + world if { false } From b0ad785bc3e07f278faea316b224d731cf140d56 Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Fri, 24 Jan 2025 10:56:58 +0100 Subject: [PATCH 5/9] Adressing some feedback --- docs/modules/opa/pages/usage-guide/user-info-fetcher.adoc | 4 +--- docs/modules/opa/partials/supported-versions.adoc | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/modules/opa/pages/usage-guide/user-info-fetcher.adoc b/docs/modules/opa/pages/usage-guide/user-info-fetcher.adoc index 81cf5048..6c9f90ba 100644 --- a/docs/modules/opa/pages/usage-guide/user-info-fetcher.adoc +++ b/docs/modules/opa/pages/usage-guide/user-info-fetcher.adoc @@ -16,7 +16,7 @@ metadata: name: opa spec: image: - productVersion: 0.67.1 + productVersion: 1.0.0 clusterConfig: userInfo: # <1> backend: @@ -132,8 +132,6 @@ For example, the following rule allows access for users in the `/admin` group: ---- package test -import rego.v1 - default allow := false allow if { diff --git a/docs/modules/opa/partials/supported-versions.adoc b/docs/modules/opa/partials/supported-versions.adoc index f7b0d816..f221808e 100644 --- a/docs/modules/opa/partials/supported-versions.adoc +++ b/docs/modules/opa/partials/supported-versions.adoc @@ -2,5 +2,5 @@ // This is a separate file, since it is used by both the direct OPA documentation, and the overarching // Stackable Platform documentation. -* 0.67.1 -* 0.66.0 (deprecated) +* 1.0.0 +* 0.67.1 (deprecated) From 3c673d592a27552953b3baf307395bafaa04f1c7 Mon Sep 17 00:00:00 2001 From: Maximilian Wittich <56642549+Maleware@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:58:16 +0100 Subject: [PATCH 6/9] Update CHANGELOG.md Co-authored-by: Sebastian Bernauer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba1e4692..1e17b41d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ All notable changes to this project will be documented in this file. ### Removed -- remove support for OPA 0.66.0 ([#677]) +- Removed support for OPA `0.66.0` ([#677]). [#656]: https://github.com/stackabletech/opa-operator/pull/656 [#666]: https://github.com/stackabletech/opa-operator/pull/666 From 52fc0e85aa90d2cbec218b1a38b99dedf125b74d Mon Sep 17 00:00:00 2001 From: Maximilian Wittich <56642549+Maleware@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:58:21 +0100 Subject: [PATCH 7/9] Update CHANGELOG.md Co-authored-by: Sebastian Bernauer --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e17b41d..c1903147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Run a `containerdebug` process in the background of each OPA container to collect debugging information ([#666]). -- Added support for OPA 1.0.0 ([#677]) +- Added support for OPA `1.0.0` ([#677]). ### Fixed From 47408ecc02206db0d272a092c26688427bf6f0ec Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Fri, 24 Jan 2025 11:12:17 +0100 Subject: [PATCH 8/9] Addressing last part of feedbakc --- tests/test-definition.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index a8ecd636..aa2bdfe0 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -3,11 +3,13 @@ dimensions: - name: opa values: # To use a custom image, add a comma and the full name after the product version + # 0.67.1,docker.stackable.tech/stackable/opa:0.67.1-stackable0.0.0-dev - 0.67.1 - 1.0.0 - name: opa-latest values: # To use a custom image, add a comma and the full name after the product version + # 0.67.1,docker.stackable.tech/stackable/opa:0.67.1-stackable0.0.0-dev - 1.0.0 - name: keycloak values: From a770692e88bbf1cca5d95f5135bec5f9bc04752d Mon Sep 17 00:00:00 2001 From: Maxi Wittich Date: Fri, 24 Jan 2025 12:51:19 +0100 Subject: [PATCH 9/9] happy pre-commit --- tests/templates/kuttl/smoke/test-regorule.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/templates/kuttl/smoke/test-regorule.py b/tests/templates/kuttl/smoke/test-regorule.py index a3991acd..3e2a78b6 100755 --- a/tests/templates/kuttl/smoke/test-regorule.py +++ b/tests/templates/kuttl/smoke/test-regorule.py @@ -27,11 +27,19 @@ # --> {'hello': True} # url = 'http://test-opa-svc:8081/v1/data/test' - response = requests.post(args['url'], json={"input": {}}).json() + response = requests.post(args["url"], json={"input": {}}).json() - if "result" in response and "hello" in response["result"] and response["result"]["hello"]: + if ( + "result" in response + and "hello" in response["result"] + and response["result"]["hello"] + ): print("Test successful!") exit(0) else: - print("Error: received " + str(response) + " - expected: {'result': {'hello': True}}") + print( + "Error: received " + + str(response) + + " - expected: {'result': {'hello': True}}" + ) exit(-1)