Skip to content

Commit 78ea229

Browse files
committed
Remove the tech preview compliance history API
Relates: https://issues.redhat.com/browse/ACM-15291 Signed-off-by: mprahl <mprahl@users.noreply.github.com>
1 parent 95cde2e commit 78ea229

40 files changed

+12
-7836
lines changed

.github/workflows/kind.yml

-16
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,6 @@ jobs:
104104
name: coverage_e2e
105105
path: coverage_e2e.out
106106

107-
- name: E2E Tests for Compliance Events API
108-
run: |
109-
KUBECONFIG=${PWD}/kubeconfig_hub make e2e-test-coverage-compliance-events-api
110-
111-
- name: Upload Compliance Events API Test Coverage
112-
if: ${{ github.event_name == 'pull_request' && matrix.kind == 'latest'}}
113-
uses: actions/upload-artifact@v4
114-
with:
115-
name: coverage_e2e_compliance_events_api
116-
path: coverage_e2e_compliance_events_api.out
117-
118107
- name: Verify Deployment Configuration
119108
run: |
120109
make webhook
@@ -220,11 +209,6 @@ jobs:
220209
with:
221210
name: coverage_e2e
222211

223-
- name: Download Compliance Events Coverage Result
224-
uses: actions/download-artifact@v4
225-
with:
226-
name: coverage_e2e_compliance_events_api
227-
228212
- name: Download PolicyAutomation Coverage Result
229213
uses: actions/download-artifact@v4
230214
with:

.vscode/launch.json

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4-
// If you are running the compliance API tests (case 20) with this, pass the `--compliance-api-port=8385` to
5-
// Ginkgo.
64
{
75
"name": "Launch Controller",
86
"type": "go",
@@ -14,14 +12,10 @@
1412
"--log-level=4",
1513
"-v=4",
1614
"--enable-webhooks=false",
17-
"--compliance-history-api-port=8385",
18-
"--compliance-history-api-cert=dev-tls.crt",
19-
"--compliance-history-api-key=dev-tls.key"
2015
],
2116
"env": {
2217
"WATCH_NAMESPACE": "",
2318
"KUBECONFIG": "${workspaceFolder}/kubeconfig_hub",
24-
"WATCH_NAMESPACE_COMPLIANCE_EVENTS_STORE": "open-cluster-management"
2519
}
2620
},
2721
// Set FDescribe or FIt on the test to debug. Then set the desired breakpoint.

Makefile

+2-40
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ CONTROLLER_NAMESPACE ?= open-cluster-management
2828
# Handle KinD configuration
2929
CLUSTER_NAME ?= hub
3030
KIND_NAMESPACE ?= $(CONTROLLER_NAMESPACE)
31-
POSTGRES_HOST ?= localhost
3231

3332
# Test coverage threshold
3433
export COVERAGE_MIN ?= 74
@@ -143,11 +142,10 @@ generate-operator-yaml: kustomize manifests
143142
############################################################
144143

145144
.PHONY: kind-bootstrap-cluster
146-
kind-bootstrap-cluster: POSTGRES_HOST=postgres
147145
kind-bootstrap-cluster: kind-bootstrap-cluster-dev webhook kind-deploy-controller install-resources
148146

149147
.PHONY: kind-bootstrap-cluster-dev
150-
kind-bootstrap-cluster-dev: kind-create-cluster install-crds kind-controller-kubeconfig postgres
148+
kind-bootstrap-cluster-dev: kind-create-cluster install-crds kind-controller-kubeconfig
151149

152150
cert-manager:
153151
@echo Installing cert-manager
@@ -156,29 +154,6 @@ cert-manager:
156154
kubectl wait deployment -n cert-manager cert-manager --for condition=Available=True --timeout=180s
157155
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=cert-manager -n cert-manager --timeout=180s
158156

159-
postgres: cert-manager
160-
@echo "Installing Postgres"
161-
-kubectl create ns $(KIND_NAMESPACE)
162-
sed 's/open-cluster-management/$(KIND_NAMESPACE)/g' build/kind/postgres.yaml | kubectl apply --timeout=180s -f-
163-
164-
@echo "Waiting until the pods are up"
165-
@sleep 3
166-
kubectl -n $(KIND_NAMESPACE) wait --for=condition=Ready pod -l app=postgres
167-
168-
@echo "Creating the governance-policy-database secret"
169-
@kubectl -n $(KIND_NAMESPACE) get secret governance-policy-database || \
170-
kubectl -n $(KIND_NAMESPACE) create secret generic governance-policy-database \
171-
--from-literal="user=grc" \
172-
--from-literal="password=grc" \
173-
--from-literal="host=$(POSTGRES_HOST)" \
174-
--from-literal="dbname=ocm-compliance-history" \
175-
--from-literal="ca=$$(kubectl -n $(KIND_NAMESPACE) get secret postgres-cert -o json | jq -r '.data["ca.crt"]' | base64 -d)"
176-
177-
@echo "Copying the compliance API certificates locally"
178-
kubectl -n $(KIND_NAMESPACE) get secret compliance-api-cert -o json | jq -r '.data["tls.crt"]' | base64 -d > dev-tls.crt
179-
kubectl -n $(KIND_NAMESPACE) get secret compliance-api-cert -o json | jq -r '.data["ca.crt"]' | base64 -d >> dev-ca.crt
180-
kubectl -n $(KIND_NAMESPACE) get secret compliance-api-cert -o json | jq -r '.data["tls.key"]' | base64 -d > dev-tls.key
181-
182157
webhook: cert-manager
183158
-kubectl create ns $(KIND_NAMESPACE)
184159
sed -E 's,open-cluster-management(.svc|/|$$),$(KIND_NAMESPACE)\1,g' deploy/webhook.yaml | kubectl apply -f -
@@ -207,10 +182,6 @@ kind-deploy-controller-dev: kind-deploy-controller
207182
kubectl rollout restart deployment/$(IMG) -n $(KIND_NAMESPACE)
208183
kubectl rollout status -n $(KIND_NAMESPACE) deployment $(IMG) --timeout=180s
209184

210-
# Specify KIND_VERSION to indicate the version tag of the KinD image
211-
.PHONY: kind-create-cluster
212-
kind-create-cluster: KIND_ARGS += --config build/kind/kind-config.yaml
213-
214185
.PHONY: kind-delete-cluster
215186
kind-delete-cluster:
216187
kind delete cluster --name $(KIND_NAME)
@@ -256,7 +227,7 @@ install-resources:
256227
@echo setting a Hub cluster DNS name
257228
kubectl apply -f test/resources/case5_policy_automation/cluster-dns.yaml
258229

259-
E2E_LABEL_FILTER = --label-filter="!webhook && !compliance-events-api && !policyautomation"
230+
E2E_LABEL_FILTER = --label-filter="!webhook && !policyautomation"
260231
.PHONY: e2e-test
261232
e2e-test: e2e-dependencies
262233
$(GINKGO) -v --fail-fast $(E2E_TEST_ARGS) $(E2E_LABEL_FILTER) test/e2e -- $(E2E_TEST_CODE_ARGS)
@@ -265,14 +236,6 @@ e2e-test: e2e-dependencies
265236
e2e-test-webhook: E2E_LABEL_FILTER = --label-filter="webhook"
266237
e2e-test-webhook: e2e-test
267238

268-
.PHONY: e2e-test-compliance-events-api
269-
e2e-test-compliance-events-api: E2E_LABEL_FILTER = --label-filter="compliance-events-api"
270-
e2e-test-compliance-events-api: e2e-test
271-
272-
.PHONY: e2e-test-coverage-compliance-events-api
273-
e2e-test-coverage-compliance-events-api: E2E_TEST_ARGS = --json-report=report_e2e_compliance_events_api.json --covermode=atomic --coverpkg=open-cluster-management.io/governance-policy-propagator/controllers/complianceeventsapi --coverprofile=coverage_e2e_compliance_events_api.out --output-dir=.
274-
e2e-test-coverage-compliance-events-api: e2e-test-compliance-events-api
275-
276239
.PHONY: e2e-test-policyautomation
277240
e2e-test-policyautomation: E2E_LABEL_FILTER = --label-filter="policyautomation"
278241
e2e-test-policyautomation: e2e-test
@@ -296,7 +259,6 @@ e2e-stop-instrumented:
296259

297260
.PHONY: e2e-test-coverage
298261
e2e-test-coverage: E2E_TEST_ARGS = --json-report=report_e2e.json --output-dir=.
299-
e2e-test-coverage: E2E_TEST_CODE_ARGS = --compliance-api-port=8385
300262
e2e-test-coverage: e2e-run-instrumented e2e-test e2e-stop-instrumented
301263

302264
.PHONY: e2e-test-coverage-policyautomation

README.md

-20
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,6 @@ in particular, the details in `./deploy/manager/manager.yaml`. When any of those
8585
deployment yaml `./deploy/operator.yaml` must be regenerated through the `make generate-operator-yaml` target. The
8686
`./deploy/operator.yaml` SHOULD NOT be manually updated.
8787

88-
## Running the Compliance Events API
89-
90-
Create the KinD cluster and install Postgres with the following commands:
91-
92-
```bash
93-
make kind-bootstrap-cluster-dev
94-
```
95-
96-
You can connect to the Postgres server with the following command:
97-
98-
```bash
99-
psql "host=localhost dbname=ocm-compliance-history user=grc password=grc"
100-
```
101-
102-
Run the Governance Policy Propagator with the following command:
103-
104-
```bash
105-
WATCH_NAMESPACE="" WATCH_NAMESPACE_COMPLIANCE_EVENTS_STORE="open-cluster-management" go run main.go --leader-elect=false --enable-webhooks=false
106-
```
107-
10888
## References
10989

11090
- The `governance-policy-propagator` is part of the `open-cluster-management` community. For more information, visit:

build/common/config/.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ issues:
223223
# Disable the lint failure about the name "stuttering"
224224
- linters:
225225
- revive
226-
source: type (PolicyStatusReconciler|ComplianceDBSecretReconciler) struct
226+
source: type (PolicyStatusReconciler) struct
227227

228228
# Independently from option `exclude` we use default exclude patterns,
229229
# it can be disabled by this option. To list all

build/kind/kind-config.yaml

-10
This file was deleted.

build/kind/postgres.yaml

-158
This file was deleted.

0 commit comments

Comments
 (0)