Skip to content

Commit 17cf2a5

Browse files
authored
Merge branch 'open-cluster-management-io:main' into main
2 parents 6047f27 + 7e4f8ca commit 17cf2a5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

config/samples/clusterpermission_existing_roles.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
kind: ServiceAccount
1616
name: sa-sample-existing
1717
- name: kubevirt-rb-cluster1
18-
namespace: kubevirt
18+
namespace: kube-system
1919
roleRef:
2020
apiGroup: rbac.authorization.k8s.io
2121
kind: Role

e2e/run_e2e.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,22 @@ else
5151
echo "clusterpermission-sample clusterrolebinding not found"
5252
exit 1
5353
fi
54+
55+
echo "TEST ClusterPermission with existing roles"
56+
kubectl config use-context kind-hub
57+
kubectl apply -f config/samples/clusterpermission_existing_roles.yaml -n cluster1
58+
sleep 10
59+
work_kubectl_command=$(kubectl -n cluster1 get clusterpermission clusterpermission-existing-role-sample -o yaml | grep kubectl | grep ManifestWork)
60+
if $work_kubectl_command; then
61+
echo "ManifestWork found"
62+
else
63+
echo "ManifestWork not found"
64+
exit 1
65+
fi
66+
67+
if kubectl -n default get rolebinding default-rb-cluster1; then
68+
echo "default-rb-cluster1 rolebinding found"
69+
else
70+
echo "default-rb-cluster1 rolebinding not found"
71+
exit 1
72+
fi

0 commit comments

Comments
 (0)