Skip to content

Commit

Permalink
Fix e2e manual remediation for resource quota
Browse files Browse the repository at this point in the history
This is to fix the e2e failures of resource_requests_quota_per_project caused by manual remediation of antoher rule/
  • Loading branch information
Vincent056 committed Sep 6, 2024
1 parent 3d06a8e commit f7c7d3b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash



# Deploy a resource quota for e2e-test namespace, this namespace is created by the e2e-remediation.sh script
# under the applications/openshift/networking/configure_network_policies_namespaces/tests/ocp4/e2e-remediation.sh
# let's create a new project anyway because this could run before the other script
cat << EOF | oc apply -f -
---
apiVersion: v1
kind: Namespace
metadata:
name: e2e-test
EOF

cat << EOF | oc apply -n e2e-test -f -
---
apiVersion: v1
kind: ResourceQuota
metadata:
name: e2e-test-namespace-quotas
spec:
hard:
count/daemonsets.apps: "0"
count/deployments.apps: "0"
limits.cpu: "0"
limits.memory: "0"
pods: "0"
EOF
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash
oc adm new-project e2e-test
cat << EOF | oc apply -f -
---
apiVersion: v1
kind: Namespace
metadata:
name: e2e-test
EOF
sleep 10
# Deploy a single NetworkPolicy per non control plane namespace
for NS in $(oc get namespaces -o json | jq -r '.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default") | .metadata.name'); do
Expand Down

0 comments on commit f7c7d3b

Please sign in to comment.