Skip to content

Commit

Permalink
Remove the tech preview compliance history API
Browse files Browse the repository at this point in the history
  • Loading branch information
mprahl authored and openshift-merge-bot[bot] committed Nov 5, 2024
1 parent 06186f4 commit 96e1bd9
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 1,146 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ jobs:
export COVERAGE_E2E_OUT=coverage_e2e_hosted_mode.out
KUBECONFIG=${PWD}/kubeconfig_managed make e2e-test-coverage
- name: E2E Tests for Compliance Events API Integration
run: |
KUBECONFIG=${PWD}/kubeconfig_managed make e2e-test-coverage-compliance-events-api
- name: Verify Deployment Configuration
run: |
make build-images
Expand Down
3 changes: 1 addition & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"--leader-elect=false",
"--cluster-namespace=managed",
"--cluster-namespace-on-hub=managed",
"--log-level=3",
"--compliance-api-url=http://127.0.0.1:8385"
"--log-level=3"
]
},
// Set FDescribe or FIt on the test to debug. Then set the desired breakpoint.
Expand Down
15 changes: 1 addition & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ GOOS = $(shell go env GOOS)
TESTARGS_DEFAULT := -v
export TESTARGS ?= $(TESTARGS_DEFAULT)

COMPLIANCE_API_URL ?= http://127.0.0.1:8385

# Get the branch of the PR target or Push in Github Action
ifeq ($(GITHUB_EVENT_NAME), pull_request) # pull request
BRANCH := $(GITHUB_BASE_REF)
Expand All @@ -47,11 +45,10 @@ HUB_CONFIG_INTERNAL ?= $(PWD)/kubeconfig_hub_internal
MANAGED_CONFIG ?= $(PWD)/kubeconfig_managed
deployOnHub ?= false
CONTROLLER_NAME ?= $(shell cat COMPONENT_NAME 2> /dev/null)
E2E_FILTER = --label-filter="!compliance-events-api"
# Set the Kind version tag
ifeq ($(KIND_VERSION), minimum)
KIND_ARGS = --image kindest/node:v1.19.16
E2E_FILTER = --label-filter="!skip-minimum && !compliance-events-api"
E2E_FILTER = --label-filter="!skip-minimum"
else ifneq ($(KIND_VERSION), latest)
KIND_ARGS = --image kindest/node:$(KIND_VERSION)
else
Expand Down Expand Up @@ -252,16 +249,6 @@ e2e-test-uninistall:
e2e-test-uninstall-coverage: COVERAGE_E2E_OUT = coverage_e2e_uninstall_controller.out
e2e-test-uninstall-coverage: e2e-run-instrumented scale-down-deployment e2e-test-uninistall e2e-stop-instrumented

.PHONY: e2e-test-compliance-events-api
e2e-test-compliance-events-api:
COMPLIANCE_API_URL=$(COMPLIANCE_API_URL) $(GINKGO) -v --fail-fast $(E2E_TEST_ARGS) --label-filter="compliance-events-api" test/e2e

.PHONY: e2e-test-coverage-compliance-events-api
e2e-test-coverage-compliance-events-api:
COVERAGE_E2E_OUT=coverage_e2e_compliance_events_api.out COMPLIANCE_API_URL=$(COMPLIANCE_API_URL) $(MAKE) e2e-run-instrumented
$(MAKE) e2e-test-compliance-events-api
$(MAKE) e2e-stop-instrumented

.PHONY: scale-down-deployment
scale-down-deployment:
kubectl scale deployment $(IMG) -n $(KIND_NAMESPACE) --replicas=0 --kubeconfig=$(MANAGED_CONFIG)_e2e
Expand Down
140 changes: 0 additions & 140 deletions controllers/complianceeventssync/disabled_events_sync.go

This file was deleted.

12 changes: 2 additions & 10 deletions controllers/gatekeepersync/gatekeeper_constraint_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,8 @@ func (r *GatekeeperConstraintReconciler) Reconcile(
pkn := policyKindName{Policy: policy.Name, Kind: templateGVK.Kind, Name: constraintName}
constraintsSet[pkn] = true

constraintGVR := schema.GroupVersionResource{
Group: utils.GConstraint,
// https://github.com/open-policy-agent/frameworks/blob/v0.9.0/constraint/pkg/client/crds/crds.go#L34
Resource: strings.ToLower(templateGVK.Kind),
// This uses v1beta1 even if the constraint in the template may have a newer version in the future so that
// the schema is consistent for status parsing. At the time of this writing, v1beta1 is the latest.
Version: "v1beta1",
}

crdName := fmt.Sprintf("%s.%s", constraintGVR.Resource, constraintGVR.Group)
// https://github.com/open-policy-agent/frameworks/blob/v0.9.0/constraint/pkg/client/crds/crds.go#L34
crdName := fmt.Sprintf("%s.%s", strings.ToLower(templateGVK.Kind), utils.GConstraint)

// Getting the CRD first creates a watch so that if the constraint template gets cleaned up and thus the
// CRD is deleted, the watch on the constraint can get cleaned up.
Expand Down
Loading

0 comments on commit 96e1bd9

Please sign in to comment.