Skip to content

Commit

Permalink
Add a role to handle the resources created by the test CRD (#418)
Browse files Browse the repository at this point in the history
* Add a role to handle the resources created by the test CRD

This allows the test "access-control-crd-roles" to run.
  • Loading branch information
jmontesi authored Apr 11, 2024
1 parent 8bd83a8 commit 169d2a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/delete-test-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ SCRIPT_DIR=$(dirname "$0")
# shellcheck disable=SC1091 # Not following.
source "$SCRIPT_DIR"/init-env.sh

# Delete test deployment
# Delete role
oc delete role crdexample-role -n "${TNF_EXAMPLE_CNF_NAMESPACE}" --ignore-not-found=true

# Delete CRD
oc delete crd crdexamples.test-network-function.com --ignore-not-found=true
10 changes: 10 additions & 0 deletions test-target/local-crd-under-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ spec:
- name: Age
jsonPath: .metadata.creationTimestamp
type: date
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: tnf
name: crdexample-role
rules:
- apiGroups: ["test-network-function.com"]
resources: ["crdexamples"]
verbs: ["get", "watch", "list"]

0 comments on commit 169d2a3

Please sign in to comment.