Skip to content

Commit 169d2a3

Browse files
authored
Add a role to handle the resources created by the test CRD (#418)
* Add a role to handle the resources created by the test CRD This allows the test "access-control-crd-roles" to run.
1 parent 8bd83a8 commit 169d2a3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

scripts/delete-test-crds.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ SCRIPT_DIR=$(dirname "$0")
66
# shellcheck disable=SC1091 # Not following.
77
source "$SCRIPT_DIR"/init-env.sh
88

9-
# Delete test deployment
9+
# Delete role
10+
oc delete role crdexample-role -n "${TNF_EXAMPLE_CNF_NAMESPACE}" --ignore-not-found=true
11+
12+
# Delete CRD
1013
oc delete crd crdexamples.test-network-function.com --ignore-not-found=true

test-target/local-crd-under-test.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,13 @@ spec:
4949
- name: Age
5050
jsonPath: .metadata.creationTimestamp
5151
type: date
52+
---
53+
apiVersion: rbac.authorization.k8s.io/v1
54+
kind: Role
55+
metadata:
56+
namespace: tnf
57+
name: crdexample-role
58+
rules:
59+
- apiGroups: ["test-network-function.com"]
60+
resources: ["crdexamples"]
61+
verbs: ["get", "watch", "list"]

0 commit comments

Comments
 (0)